ServiceNow Tools · LessonBy Praveen T, ServiceNow Trainer, 9 yrs · Published · current release · utility
Background scripts
Run server-side script on demand, carefully.
Quick answer
Scripts - Background runs server-side JavaScript immediately. Powerful and dangerous, it writes to real data.
Scripts - Background runs server-side JavaScript immediately. Powerful and dangerous, it writes to real data.
- Always test on a sub-production instance first.
- Read before you write, comment out
update()/deleteRecord()until verified. - Use
gs.info()to confirm the affected set. - Batch large operations with
setLimit().
Try the read-only version below safely in the sandbox:
Try it YourselfJavaScript
▸ Press Run to execute.
Runs in a sandbox in your browser. Mock gs and GlideRecord and sample data are provided.
Quick check
+0 XPStreak ×0
Question 1 of 2
Before writing, what should you do in a background script?
Frequently asked questions
What does the term Background scripts refer to in ServiceNow?
Scripts - Background runs server-side JavaScript immediately. Powerful and dangerous, it writes to real data.
Practise this on your own free instance.