Skip to content

Developer track

Encoded queries

The filter language behind every list, API and GlideRecord.

2 sections · 23 entries

Operators

Fastest way to get one right: build the filter in a list, then right-click the breadcrumb → Copy query.

OperatorMeaningExample
^AND
^OROR (same group)
^NQNew query: OR between whole groups
= !=Equals / not equals
LIKE NOT LIKEContains / does not contain
STARTSWITH ENDSWITHStarts / ends with
IN NOT INOne of a list
ISEMPTY ISNOTEMPTYHas no value / has a value
EMPTYSTRINGIs an empty string (not null)
ANYTHINGMatches every value
> < >= <=Comparisons
BETWEENRange, inclusive
SAMEAS NSAMEASCompare two fields on the same record
INSTANCEOFRecord is this class or a child class
dot-walkFilter on a referenced record’s field
ORDERBY ORDERBYDESCSort

Dates & dynamic values

Relative filters that keep working tomorrow.

PatternMeaningExample
ONTodayCreated today
RELATIVEGTIn the last N hours/days
RELATIVELTOlder than N days
javascript:gs.daysAgoStart(n)Start of the day n days ago
javascript:gs.getUserID()The current user
javascript:gs.getUser().getMyGroups()Any of my groups
VALCHANGES CHANGESTOField changed (business rule / notification conditions)

Snippets are provided as-is under the MIT licence, without warranty. Test in a sub-production instance first. ServiceNow is a trademark of ServiceNow, Inc.; this page is independent and not affiliated with or endorsed by ServiceNow.