Script Editing & Recovery
Recover unsaved script changes, open the full-screen editor, and look up properties and messages.
Last updated: November 12, 2026
Script Recovery
SN Utils automatically backs up unsaved changes in script fields to the browser's session storage. Within the same tab, these backups can help you recover after a session timeout or navigation away from the record.
How it works:
- Every script field on a form is monitored for changes. When you edit code, SN Utils saves a local backup after a short debounce (3 seconds of inactivity).
- Backups are kept separately for each record and script field, so multi-field records (e.g. a Business Rule with both Script and Condition) are handled correctly.
- When you reopen the record, SN Utils compares the server version with the local backup. If they differ, a yellow recovery icon appears next to the field label.
Recovering a script:
- Click the recovery icon to open a side-by-side diff view showing the current server version (left) and your backed-up version (right).
- Review the differences, then choose:
- Apply Backup: replaces the editor content with your backup so you can save normally
- Discard: permanently removes the backup
- Close: dismisses the dialog without changes; the icon remains for later
The backup is automatically cleaned up when the editor content matches the saved version (i.e. after a successful save).
Settings: Script Recovery is enabled by default. It can be toggled via the scriptrecovery setting.
Full Screen Monaco Editor
When "Enable Code Editor buttons" is enabled, you can open a full-screen editor for code fields.
Script Editor Hover Lookups
In ServiceNow's native Monaco script editors, including Background Scripts, hover a gs.getProperty('name') call to see the property's value, type and description, with a link to the System Property record. Hover a gs.getMessage('key') or gs.getMessageS('key') call to see the message in every language it exists in, with a link to the Messages list filtered on that key. If nothing matches, the pop-up links to a filtered search so you can create the record.
Version Tools
See Version Tools for version history, the Versions modal, script comparisons, changed-field sorting, and field-level change percentages.