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.
| Operator | Meaning | Example |
|---|---|---|
| ^ | AND | |
| ^OR | OR (same group) | |
| ^NQ | New query: OR between whole groups | |
| = != | Equals / not equals | |
| LIKE NOT LIKE | Contains / does not contain | |
| STARTSWITH ENDSWITH | Starts / ends with | |
| IN NOT IN | One of a list | |
| ISEMPTY ISNOTEMPTY | Has no value / has a value | |
| EMPTYSTRING | Is an empty string (not null) | |
| ANYTHING | Matches every value | |
| > < >= <= | Comparisons | |
| BETWEEN | Range, inclusive | |
| SAMEAS NSAMEAS | Compare two fields on the same record | |
| INSTANCEOF | Record is this class or a child class | |
| dot-walk | Filter on a referenced record’s field | |
| ORDERBY ORDERBYDESC | Sort |
Dates & dynamic values
Relative filters that keep working tomorrow.
| Pattern | Meaning | Example |
|---|---|---|
| ONToday | Created today | |
| RELATIVEGT | In the last N hours/days | |
| RELATIVELT | Older 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 CHANGESTO | Field changed (business rule / notification conditions) |
Nothing on this page matches. Try the search on the hub.
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.