Correct Answer: D
In ServiceNow, Client Scripts are scripts that execute in the user's web browser rather than on the server. They are used to enhance user experience by dynamically controlling form behavior, validating user input, or performing real-time updates without requiring a server request.
Types of Scripts in ServiceNow:
Script Type
Runs On
Purpose
Client Script
Web browser (client-side)
Modify UI behavior, perform field validations, or respond to user interactions.
Server Script
ServiceNow backend (server-side)
Processes data, enforces business rules, and performs background operations.
Database Script
Database layer
Used for stored procedures or database triggers (not applicable in ServiceNow).
Local Script
Not an actual ServiceNow script type
No such category exists in ServiceNow.
Key Features of Client Scripts:
Runs in the web browser when a form is loaded, changed, or submitted.
Can manipulate field values, display messages, or enforce rules in real time.
Uses GlideForm (g_form) and GlideUser (g_user) APIs.
Reduces server load by executing logic without sending requests to the backend.
Why Other Options Are Incorrect?
A . Server script:
Runs on the server-side, not in the browser.
Examples: Business Rules, Script Includes, Scheduled Jobs.
B . Local script:
No such script type in ServiceNow.
C . Database script:
ServiceNow does not allow direct database scripting.
Official ServiceNow Documentation Reference:
Client Scripts Overview
Scripting Best Practices