📝 ServiceNow Scripting Patterns
Writing better ServiceNow scripts
ServiceNow scripting has its own idioms. The strongest patterns in this repo focus on query design, data access, client-server boundaries, and readable automation code.
What you’ll learn
- When to query the child table directly instead of reaching through a parent table.
- How to keep scripts explicit and easier to maintain.
- Cleaner patterns for GlideAjax, URL handling, and other day-to-day tasks.
- Practical workflow and platform scripting techniques taken from real implementation work.
Querying ref_ Fields on Extended Tables
ref_ queries are one of those ServiceNow features that are useful, slightly obscure, and easy to misuse. They show up when you start from a base table such as task, but …
ACL Misconceptions That Hurt Performance
ACLs are easy to treat as a pure security feature and forget that they also sit on a hot path. When an instance loads a form, renders a list, or reads fields through …
Minimize Server Lookups in Client Scripts
Client scripts get slow and noisy when every small decision turns into another server call. Most of the time, the real problem is not the API. It is choosing the wrong …
Querying Tables Best Practices
Querying tables is one of those things that looks harmless until the same script runs against production-sized data. A query that feels fine with a few hundred records …
GlideSubstituteURL: The Useful Part
If you look up GlideSubstituteURL, the method list can be distracting. You see names like notify(), notifyAll(), wait(), hashCode(), equals(), and getClass(), and it is …
ACL: understanding Advanced flag
When editing an ACL record there is a flag “Advanced” Wrong opinion: setting Advanced flag to false deactivates execution of script (field …
iKosak Sync Now is open source
VS Code extension iKosak Sync Now for ServiceNow development is now open source. Hosted on Github, powered by Github Actions and everyone can contribute 🎉. Go check the …
Resume workflow
A few ways to resume a stucked workflow
Using Moment.js in ServiceNow
Moment.js is great library for interacting with date and time. It helps you parse, validate, manipulate, and display dates. Did not hear about Moment.js? Check the docs. …
VS Code extension for ServiceNow
Edit ServiceNow scripts with your text editor and upload with a shortcut when done
Popup info links for Service Portal
Sometimes customer needs to put much text into the Annotation for a Catalog Variable. Here is how we can show this information using a modal popup. We will link a KB …
Fixed query for left navigation
This article will tell you about the posibility of setting fixed filter parameters for navigarion module. User is not able bypass such filter. Goal Click on …
Exclude table from UpdateSet
All customizations made in tables, that extending sys_metadata are tracked to current UpdateSet. But sometimes we need to exclude some of them. Goal You want some …