📝 ServiceNow Scripting Patterns

13 articles
JavaScript ServiceNow GlideRecord Client Script

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
Mar 14, 2026 5 min read

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 …

ServiceNowGlideRecordPerformanceTable Extension
ACL Misconceptions That Hurt Performance
Feb 2, 2026 5 min read

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 …

ServiceNowACLSecurityPerformance
Minimize Server Lookups in Client Scripts
Jan 4, 2026 4 min read

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 …

ServiceNowClient ScriptJavaScriptPerformance
Querying Tables Best Practices
Oct 15, 2025 4 min read

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 …

ServiceNowGlideRecordPerformance
GlideSubstituteURL: The Useful Part
Sep 25, 2023 4 min read

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 …

ServiceNowJavaScriptURLScripting
Jan 18, 2022 1 min read

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 …

ServiceNow
iKosak Sync Now is open source
May 20, 2020 1 min read

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 …

ServiceNowVS Code
Apr 16, 2020 1 min read

Resume workflow

A few ways to resume a stucked workflow

ServiceNowWorkflow
Using Moment.js in ServiceNow
Mar 12, 2020 3 min read

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. …

ServiceNowMomentJS
VS Code extension for ServiceNow
Mar 1, 2020 2 min read

VS Code extension for ServiceNow

Edit ServiceNow scripts with your text editor and upload with a shortcut when done

ServiceNowVS Code
Popup info links for Service Portal
Jan 12, 2020 2 min read

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 …

ServiceNowService Portal
Fixed query for left navigation
Jan 5, 2020 1 min read

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 …

ServiceNow
Exclude table from UpdateSet
Jan 1, 2020 1 min read

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 …

ServiceNow