Custom Commands

Create your own SN Utils slash commands with custom searches, URL templates, and context menu integration.

You can create custom slash commands tailored to your workflow.

Creating a Basic Custom Command

Let's create a custom incident search command:

  1. Open the incident table with filters: /incident -f
  2. Create a filter: Number CONTAINS $0 Or Short Description CONTAINS $0
  3. Click the Updated column to sort by Updated descending

Build this filter

  1. Open the Manage page (gear icon in the popup header, or /manage) and go to the Commands tab
  2. Click New Custom and choose Prefill from Open Tabs
  3. Select the incident tab from the suggestions — URL, Hint, and Fields get prefilled from your current list

Prefilled custom slash command

  1. Name the command inc
  2. Adjust fields to number,short_description
  3. Click Save

New /inc command in action

Test with /inc sap and Right Arrow — you'll see results with number and short description fields. This command works across all your instances!

Commands Tab Overview

The Commands tab on the Manage page is where you create, edit, and manage all your slash commands.

  1. Search existing commands — Click a result to edit it (you can overwrite built-in commands except scripted ones)
  2. New Custom — Create a new command from scratch or prefill from open tabs
  3. URL field — Use variables like $0, $sysid. Start URL with / to always open in new tab
  4. Icon indicator — Custom, built-in, or scripted command
  5. Delete button — Remove custom commands
  6. Order — Set order < 100 to always show at top
  7. Marketplace — Install curated Content Packs with ready-made commands

URL Variables

VariableDescription
$0Search term
$1, $2...Individual words from the search term
$sysidCurrent record sys_id
$tableCurrent table name
$encodedqueryCurrent list/filter encoded query (when available)
$fieldnameValue from inline result fields
$ext/SN Utils extension asset base URL

Need the full reference with examples and script helpers?

See: Variables & Helper Methods

Overwrite Target URL

Some commands filter records but should open a different page. Use "Overwrite target URL" for this.

Example: The /uibe command searches experiences but opens UI Builder directly:

Overwrite target URL slash command

  1. URL with sysparm_query= — Recognized as table filtering command
  2. Fields — First two display in popup; additional fields (like admin_panel.sys_id) available for target URL
  3. Overwrite URL — Uses field variables like $admin_panel.sys_id

Running /uibe util:

Beauty in action

  1. Run command with search term
  2. Results show inline (default behavior with overwrite)
  3. Links point to UI Builder, not the record
  4. Use CTRL-Enter to open classic list instead
  5. Switches still work!

Context Menu Integration

Add #contextmenu to a command's URL to make it available in the right-click context menu:

Add #contextmenu

After saving:

Use new context menu item

Custom Switches

Custom switches have their own dedicated Switches tab on the Manage page. Start with the guide: Slash Switches.

Advanced examples are also available at arnoudkooi.com/switch.

Legacy JSON Editing

If you prefer editing commands and switches as raw JSON, you can find the legacy JSON editors under Settings > Advanced on the Manage page. This is useful for bulk editing, copying, or backing up your custom commands and switches. Always ensure valid JSON when editing.