Exploring scripting

concept brazil Updated Sep 10, 2026 2 min read c_Script.md
Raw file servicenow.com

Learn how to use scripts to extend your instance beyond standard configurations. With scripts, you can automate processes, add functionality, integrate your instance with an outside application and more.

ServiceNow JavaScript APIs enable you to perform database operations without writing SQL queries, display UI pages, define UI actions, and more. Scripts can be server-side (run on the server or database), client-side (run in the user's browser), or run on the MID Server.

Note: Scripts can't contain reserved words.

Server-side scripts

Perform database operations. For example, use a server-side script to update a record. Create a script in a scoped application or in the global scope. Each execution context includes a set of available APIs.

  • Scoped environment

    Use scoped APIs when scripting in a scoped application. Scoped Glide APIs don't include all the methods included in the global Glide APIs, and you can't call a global Glide API in a scoped application. To learn more about application scopes, see Application scope.

  • Global environment

    The global scope is a special application scope that identifies applications developed before application scoping, or applications intended to be accessible to all other global applications. Use global APIs when scripting in the global scope.

To learn more about server-side scripting, see Writing server-side scripts.

Client-side scripts

Make changes to the appearance of forms, display different fields based on values that are entered, or change other custom display options. Client scripts allow the system to run JavaScript on the client (web browser) when client-based events occur, such as when a form loads, after form submission, or when a field changes value.

Client scripts can also be called by other scripts or modules, including UI policies. To learn more about client-side scripting, see Writing client-side scripts.

  • Available script types
    Scripts can be used in many places. The most important detail is whether the script runs on the client or the server.
  • Execution order of scripts and engines
    Scripts, assignment rules, business rules, workflows, escalations, and engines all take effect in relation to a database operation, such as insert or update. In many cases, the order of these events is important.
  • Script evaluation of fields by data type
    Script fields evaluate data based on the field type of the input.
  • Scripting alert, info, and error messages
    You can send messages to users as alerts, informational messages, or error messages.
  • Glide platform stack
    Glide is an extensible Web 2.0 development platform written in Java that facilitates rapid development of forms-based workflow applications (work orders, trouble ticketing, and project management, for example).
  • JavaScript syntax editor
    The JavaScript syntax editor provides support for editing JavaScript scripts.

Parent Topic:Scripting on the ServiceNow AI Platform

Related topics

Server API reference

Client API reference

Search documentation
Search document titles and file paths on the brazil branch