Script includes

Script includes are at the heart of scripting in ServiceNow, and are arguably the most commonly used when it comes to writing code. Script includes are used to hold classes of code, and for a lot of the backend script used by the ServiceNow platform.

When creating your script include, you first need to give it a name. This name will be important, as it will be used in other code to call the methods in your script include.

Ensure that the name you choose for your script include does not contain spaces in it. It is best to use underscores to separate words in the name.

Once you enter a name for your script include, you will notice that the API Name and the script fields are populated. The API name is read-only, and given based ...

Get Mastering ServiceNow Scripting now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.