In ServiceNow,Client Scriptsare scripts that execute in the user'sweb browserrather 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.
Runsin the web browserwhen a form is loaded, changed, or submitted.
Can manipulate field values, display messages, or enforce rules in real time.
UsesGlideForm (g_form)andGlideUser (g_user)APIs.
Reduces server load by executing logic without sending requests to the backend.
A. Server script:
Runs on theserver-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.
Client Scripts Overview
Scripting Best Practices
Key Features of Client Scripts:Why Other Options Are Incorrect?Official ServiceNow Documentation Reference: