Background scripts
concept brazil Updated Sep 10, 2026 1 min read c_ScriptsBackground.md
Administrators can use the Scripts - Background module to run arbitrary JavaScript code from the server.
The Scripts - Background module consists of the following components.
- Text box to enter JavaScript.
- Selector to specify the application scope.
- Run script button.
- List of available scopes.
- Record for rollback? check box. Selected by default. Creates a rollback context for the script execution. After the script is run, click the Script execution and recovery available here link to go to the Script Execution History form where you can rollback the script.
- Execute in sandbox? check box. Allows script to run with sandbox like restrictions. If checked, data cannot be inserted, updated, or deleted.
- Execute as scriptlet? check box. Allows the script to execute as a scriplet, which gives the script access to the global scope and any server-side functionality or objects. If the check box is not selected, the script executes in global scope, but does not have access to any server-side functionality or objects.
- Cancel after 4 hours check box. Selected by default. Cancels the script execution if it continues running after four hours.
When a script is run, the instance displays results, information, and error messages at the top of the screen.
Important: Running free-form JavaScript can cause system disruption or data loss. Do not run free-form scripts from a production instance.
To stop a transaction, see View and kill active transaction.
For examples of scripts you could run, see Example scripts.
Parent Topic:Writing server-side scripts
40 lines · 2.5 KB
--- title: Background scripts description: Administrators can use the Scripts - Background module to run arbitrary JavaScript code from the server. locale: en-US canonical_url: https://www.servicenow.com/docs/r/api-reference/scripts/c\_ScriptsBackground.html release: brazil product: Scripts classification: scripts topic_type: concept last_updated: "2026-09-10" reading_time_minutes: 1 breadcrumb: [Write server-side scripts, Scripting, API implementation, API implementation and reference] --- # Background scripts Administrators can use the **Scripts - Background** module to run arbitrary JavaScript code from the server. The Scripts - Background module consists of the following components. - Text box to enter JavaScript. - Selector to specify the application scope. - **Run script** button. - List of available scopes. - **Record for rollback?** check box. Selected by default. Creates a rollback context for the script execution. After the script is run, click the **Script execution and recovery available here** link to go to the **Script Execution History** form where you can rollback the script. - **Execute in sandbox?** check box. Allows script to run with sandbox like restrictions. If checked, data cannot be inserted, updated, or deleted. - **Execute as scriptlet?** check box. Allows the script to execute as a scriplet, which gives the script access to the global scope and any server-side functionality or objects. If the check box is not selected, the script executes in global scope, but does not have access to any server-side functionality or objects. - **Cancel after 4 hours** check box. Selected by default. Cancels the script execution if it continues running after four hours. When a script is run, the instance displays results, information, and error messages at the top of the screen. **Important:** Running free-form JavaScript can cause system disruption or data loss. Do not run free-form scripts from a production instance. To stop a transaction, see [View and kill active transaction](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/brazil/markdown/platform-administration/t_ViewAndKillAnActiveTransaction.md). For examples of scripts you could run, see [Example scripts](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/brazil/markdown/api-reference/scripts/usefulScripts.md). **Parent Topic:**[Writing server-side scripts](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/brazil/markdown/api-reference/scripts/server-side-scripting-overview.md)
| title | Background scripts |
| description | Administrators can use the Scripts - Background module to run arbitrary JavaScript code from the server. |
| locale | en-US |
| canonical_url | https://www.servicenow.com/docs/r/api-reference/scripts/c\_ScriptsBackground.html |
| release | brazil |
| product | Scripts |
| classification | scripts |
| topic_type | concept |
| last_updated | 2026-09-10 |
| reading_time_minutes | 1 |
| breadcrumb | Write server-side scriptsScriptingAPI implementationAPI implementation and reference |