Slash Switches
Learn how slash switches modify command behavior in SN Utils, including filters, URL params, ordering, and time-based queries.
Last updated: February 26, 2026
Slash switches are small flags you add after a command to change what it does.
Example:
/p ui.session -s -p
/p= base command (System Properties)ui.session= search term (matched against the command's default field — herename)-sand-p= switches that modify behavior
Switch Categories
Most switches fall into one of these groups:
| Type | What It Does | Example |
|---|---|---|
| Filter switch | Adds a filter condition | -a for active records |
| URL switch | Adds URL params | -p to keep filters pinned |
| Sort switch | Adds ordering | -ud for updated desc |
| Action switch | Opens related targets | -t for table definition |
Common Everyday Switches
In below example /p is a command for the sys_properties table.
| Command | Result |
|---|---|
/p -n | Open a new record |
/p -t | Open table definition |
/p -r | Open a random record |
/p ui.session -s | Search in current scope |
/task -p | Keep filter pinned in list |
Time-Based Switches
Time switches let you query records by age.
Syntax:
-<type><number><unit>
Types:
-uupdated in the last...-ccreated in the last...-ucupdated or created in the last...-umupdated by me in the last...-cmcreated by me in the last...-yresolved in the last... (usesresolved_at)
Units:
ssecondsmminuteshhoursddayswweeksMmonthsqquartersyyears
Examples:
| Command | Result |
|---|---|
/incident -u5d | Updated in last 5 days |
/task -c3h | Created in last 3 hours |
/incident -uc15m | Updated or created in last 15 minutes |
/sys_script -um1w | Updated by me in last week |
/incident -y2d | Resolved in last 2 days |
Combining Multiple Switches
You can chain switches in one command:
/br myRule -u2d -s -p
That means:
- search for
myRule - only records updated in the last 2 days
- limit to current scope
- keep filter pinned
Headless Switches
You can use switches without a table command by starting with /-. The switch applies to the current list or form table.
| Command | Result |
|---|---|
/-a | Filter current list to active records |
/-c3h | Filter current list to created in last 3 hours |
/-a -c1d | Active records created in the last day |
Inline Field Filters
Use the -field:value syntax to quickly filter any field by "contains" without defining a custom switch. This works both headless and with table commands.
| Command | Result |
|---|---|
/-name:david | Current list where name contains "david" |
/sys_user -name:david -a | Active users where name contains "david" |
/incident -short_description:vpn -c1d | Incidents with "vpn" in short description, created in last day |
The field name must match the actual ServiceNow column name (e.g. short_description, not "Short description").
Custom Switches
Need custom behavior? You can define your own switches in the Switches tab on the Manage page (gear icon in the popup header, or /manage).
If you had slash switches from a pre-v10 install, those grandfathered entries remain editable as JSON under Manage > Advanced > Legacy JSON Editing — see Legacy JSON Editing for the legacy shape, the Convert-to-Custom flow, and the automatic local snapshots captured before every save. Modern custom switches are managed only via the Switches tab.
Custom Dynamic Time Switches
You can turn any date/datetime column into your own time filter — the same mechanism behind the built-in -u, -c, and -y switches. In the Switches tab, fill in the Dynamic Date Field with the column name and leave the Value field empty. SN Utils generates the time query automatically; you do not write any encoded query yourself.
Once defined, the switch works as -<key><number><unit> with the usual units (s/m/h/d/w/M/q/y).
Example — a switch for "opened in the last...":
| Field | Value |
|---|---|
| Switch Key | o |
| Description | Opened in last |
| Dynamic Date Field | opened_at |
| Fallback Field (optional) | sys_created_on |
| Value | (leave empty) |
Then use it:
| Command | Result |
|---|---|
/incident -o5d | Incidents opened in the last 5 days |
/incident -o2w | Incidents opened in the last 2 weeks |
The optional Fallback Field adds an OR clause so the filter still matches when the primary field is empty (e.g. opened_at OR sys_created_on).
Dynamic switches are stored on your device and are not synced to the cloud yet, so they stay local to the browser where you created them.
Legacy JSON Examples
If you are using the legacy JSON format under Manage > Advanced > Legacy JSON Editing, here are some example switches:
{
"s": {
"description": "Current Scope",
"value": "^sys_scope=javascript:gs.getCurrentApplicationId()",
"type": "encodedquerypart"
},
"p": {
"description": "Filter Pinned",
"value": "&sysparm_filter_pinned=true",
"type": "querypart"
},
"t": {
"description": "View Table Structure",
"value": "sys_db_object.do?sys_id=$0&sysparm_refkey=name",
"type": "link"
},
"pi": {
"description": "Pop In - Open in full UI",
"value": "/nav_to.do?uri=",
"type": "prepend"
}
}
- Full variable reference: Variables & Helper Methods