โ† Home
๐Ÿ”ฅ0 DAY
โšก0 XP
Tools ยท Developer Utility

ENCODED QUERY
BUILDER.

Build a valid ServiceNow encoded query without guessing operators. Pick a table, stack AND/OR conditions, and copy the string straight into addEncodedQuery(), a GlideAggregate report, or a sysparm_query REST call. Everything runs in your browser โ€” nothing is sent anywhere.

Presets

WHERE

Encoded query

active=true^priority=1

Paste a query from a list filter

In an instance, right-click the filter breadcrumb and choose Copy query, then paste it here to edit the conditions visually.

Copy into ServiceNow

var gr = new GlideRecord('incident');
gr.addEncodedQuery('active=true^priority=1');
gr.query();
while (gr.next()) {
  gs.info(gr.getValue('number') + ' โ†’ ' + gr.getDisplayValue('state'));
}

Encoded query syntax cheat sheet

  • ^ joins conditions with AND, ^OR with OR, and ^NQ starts a brand new query (a true OR of two whole filters).
  • Dot-walk reference fields: assignment_group.manager.active=true.
  • Relative dates use javascript: โ€” sys_created_on>=javascript:gs.daysAgoStart(7).
  • IN takes a comma list with no spaces: state IN 1,2,3 becomes stateIN1,2,3.
  • Prefer addEncodedQuery() for filters copied from lists, and addQuery() when values come from variables so they are escaped for you.

About this tool

Free ยท Browser-based ยท No signup

The SparkCoder ServiceNow Encoded Query Builder turns filter conditions into a valid sysparm_query string you can paste straight into GlideRecord, GlideAggregate, or REST calls. It is designed for ServiceNow developers, admins, and interview candidates who need to reason about queries without opening an instance.

Every condition is encoded locally in your browser โ€” no data is sent to a server. Use the presets to see common patterns, import a query copied from a list filter, and switch between GlideRecord, GlideAggregate, and REST snippets.

Built by SparkCoder, an arcade-style practice app for ServiceNow scripting interviews.