IT CanvassTalk to an advisor
ServiceNow Tools · LessonBy , 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.
Set up your free instance →
Already working on ServiceNow and stuck on a live ticket?Get an expert ServiceNow developer on screen-share to finish your daily tasks with you. Deliver on time, protect your reputation and your job. Monthly support only, no task-wise plans.Task assigned · no idea where to startStill stuck · your job on the lineExpert joins your screenDelivered on timeExplore On Job Support