Writing server-side scripts

concept brazil Updated Sep 10, 2026 2 min read server-side-scripting-overview.md
Raw file servicenow.com

Write scripts that run JavaScript on the application server to automate business processes, perform secure data operations, integrate with external systems, and more.

Server-side API reference

When writing server-side scripts, you use server-side JavaScript APIs to change the functionality of applications. For information about available client-side APIs, see the Server API reference.

  • Server-side scripts
    Server-side scripts run on the server or database. They can change the appearance or behavior of ServiceNow or run as business rules when records and tables are accessed or modified.
  • JavaScript engine on the platform
    The JavaScript engine that evaluates server-side scripts supports the ECMAScript 2021 (ES12) standard.
  • Script sandbox environment
    The script sandbox environment is a restricted execution context in which untrusted, client-generated scripts run on the server using one of two evaluators: the guarded script evaluator or the script sandbox evaluator.
  • Classic Business rules
    A business rule is a server-side script that runs when a record is displayed, inserted, updated, or deleted, or when a table is queried.
  • Script includes
    Script includes are used to store JavaScript that runs on the server.
  • Background scripts
    Administrators can use the Scripts - Background module to run arbitrary JavaScript code from the server.
  • Schedule pages
    A schedule page is a record that contains a collection of scripts that allow for custom generation of a calendar or timeline display.
  • Script processors
    Processors provide a customizable URL endpoint that can execute arbitrary server-side JavaScript code and produce output such as TEXT or JSON. Creating custom processors is deprecated.
  • Using regular expressions in server-side scripts
    JavaScript regular expressions automatically use an enhanced regex engine, which provides improved performance and supports all behaviors of standard regular expressions as defined by Mozilla JavaScript. The enhanced regex engine supports using Java syntax in regular expressions.
  • Querying tables in script
    Using methods in the GlideRecord API, you can return all records from a table, return records from a table that satisfy specific conditions, or return records that include a string from a single table or from multiple tables in a text index group.
  • Setting a GlideRecord variable to 'NULL'
    GlideRecord variables (including current) are initially null in the database. Setting these back to an empty string, a space, or the JavaScript null value will not result in a return to this initial state.
  • Calculating a due date with DurationCalculator
    Using the DurationCalculator script include, you can calculate a due date with either a simple duration or a relative duration base on schedules.
  • Parsing and extracting XML data in server-side scripts
    A JavaScript object wrapper for parsing and extracting XML data from an XML document (String).

Parent Topic:Scripting on the ServiceNow AI Platform

Related topics

Server API reference

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