Please use for the latest documentation.

This site is for reference purposes only and may not be accurate for the latest ServiceNow version

Difference between revisions of "Script in ServiceNow"

From Wiki Archive
Jump to: navigation, search
(No difference)

Revision as of 19:18, 21 September 2017

Note: This article applies to Fuji and earlier releases. For more current information, see Scripts at

The ServiceNow Wiki is no longer being updated. Visit for the latest product documentation.


Monitor small.png Use scripts to extend your instance beyond standard configurations. With scripts, you may automate processes, add functionality, integrate ServiceNow with an outside application and more. Before using scripts, review Ways to Customize Without Scripting.

APIs (Application Programming Interfaces) provide classes and methods that you can use in scripts to define functionality. ServiceNow provides APIs as JavaScript classes, web services, and other points of connection for integrations. Note that you cannot access commonly used JavaScript objects (such as DOM or Window). Jelly scripts are also used in some modules. Jelly is used to turn XML into HTML and may include both client-side and server-side scripts.

This category describes internal scripts, which change the appearance or behavior of ServiceNow by running scripts inside the platform. These scripts may be server-side (run on the server or database), client-side (run in the user's browser) or on the MID server. Use this category to configure internal scripts and to reference APIs to use in these scripts. To integrate with outside applications, see Integrations.

Note: When developing scripts for scoped applications, you must use the scoped APIs, which include scoped versions of the Glide APIs. The scoped Glide APIs do not provide all the methods included in the Global Glide APIs, and you cannot call a global Glide API in a scoped application. To start creating scoped applications, see Scripting in Scoped Applications.

General Scripting

Application Scripting

Review general information, procedures, and contexts for scripting in ServiceNow.

Differences Among Scripts
Glide Class Overview
Syntax Editor

Create scripts for custom applications.

Scripting in Scoped Applications
Scoped Script Logging
Scoped System API

Server Scripting

Client Scripting

Configure scripts that run on the server or the database.

Script Actions
Reference Qualifiers
Installation Exits

Configure scripts that run on the client (web browser).

Client Scripts
Client Script Access to Variable Fields on Task Records
Client Script Best Practices

Client API Reference

Server API Reference

Reference objects and methods to use in client-side scripts.

GlideForm (g_form)
GlideList2 (g_list)

Reference objects and methods to use in server-side scripts.



Useful Scripts

Track down errors to get the desired result from a script.

Syntax Editor
Using the Syntax Editor
Script Syntax Error Checking
JavaScript Debugger
Field Watcher
Debugging Business Rules
Business Rule Error Messages
Debugging Tools Best Practices

Reference example scripts that have been used in specific instances.

Useful Task Scripts
Useful Form Scripts
Useful User Scripts