activate_tab
01Command
Find and activate a browser tab by URL pattern. Useful for navigating to specific ServiceNow pages or ensuring a tab is ready before taking screenshots.
Use sn-scriptsync in combination with SN Utils to be able to code in VS Code, including all benefits of a full fledged code editor
Command
Find and activate a browser tab by URL pattern. Useful for navigating to specific ServiceNow pages or ensuring a tab is ready before taking screenshots.
Command
Add a column to a table by creating a sysdictionary entry (keyed by table.element). Use this instead of createartifact for dictionary entries — it avoids the map.json name collision where every column would share name = .
Command
Capture a full-page (entire scrollable page, beyond the viewport) or single-element screenshot through the Chrome debugger and save it under screenshots/. Unlike takescreenshot (viewport only, no debugger), this uses CDP to render the whole page or a specific element.
Command
Verify WebSocket server is running and browser helper tab is connected. Always call this before any other operations.
Command
Check if an artifact name already exists (checks local map.json files only, not ServiceNow).
Command
Check if an artifact exists in ServiceNow (queries the actual instance, not just local files).
Command
Remove the native-dialog handler installed by setdialoghandler and return the dialogs intercepted while it was active. Detaches the Chrome debugger unless a network/console capture is still running on the tab.
Command
Clear the last error file.
Command
Click a DOM element by CSS selector in the ServiceNow content document of the connected tab. Best-effort and light-DOM only — it does not pierce shadow DOM (Polaris/Next Experience web components). For form fields and UI actions prefer setfield / runuiaction; reach for clickelement only when there is no gform path…
Command
Run the SN Utils GraphQL field-index code search across ServiceNow script tables and return structured matches. This is the same engine as the SN Utils code search page — far better than a plain queryrecords LIKE at finding where a term actually lives in scripts (script includes, business rules, UI actions, client…
Command
Create a scoped application (sysapp). The scope is set at insert time — it is read-only afterwards, so this is the correct way to establish a new scope. The resolved scope name → sysid is recorded in scopes.json so later createartifact / addcolumn calls can target it.
Command
Create a new artifact directly via payload. This is the preferred method for AI agents - no file creation needed, executes immediately (not queued).
Command
Insert a plain data row on any table: an incident, task, sysuser, sysusergroup, cmdbci, catalog request — anything whose display field is not name.
Command
Create a custom table by inserting a sysdbobject record. ServiceNow auto-creates the physical table and its base sys fields (sysid, syscreatedon, sysupdatedon, etc.). Pair it with addcolumn for your own fields, and set the display column via addcolumn display: true. This mirrors the createapplication / addcolumn…
Command
Force-detach the Chrome debugger from the connected tab. Removes the yellow "SN Utils started debugging this browser" banner and ends any network/console capture or dialog handler still active. A safety net — stop / clear already detach when nothing else is running.
Command
Delete a scoped application: its scoped metadata (records whose sysscope is the app) and the sysapp record itself, via a guarded background script. Irreversible. Requires confirm: true and both sn-scriptsync.deleteRecords.enabled and sn-scriptsync.backgroundScripts.enabled.
Command
Delete a record by table + sysid, or bulk-delete by query. Disabled by default. Enable sn-scriptsync.deleteRecords.enabled in VS Code settings to allow it.
Command
Ask the connected SN Utils helper tab what it can do right now — the Agent API version, the license tier, whether the Chrome DevTools Protocol browser debugger (network/console capture, full-page screenshots, native dialog handling) is usable, which protocol capabilities the helper supports (two-phase command review…
Command
Get the expected file naming convention.
Command
Read the live form in the connected browser tab: its table, sysid, new-record flag, and current field values (including unsaved edits). Reads from gform, so it reflects what the user/agent actually sees — not the saved database row. Pair it with setfield to verify writes and with /tn (runslashcommand) when you need…
Command
Get instance connection info, including per-instance activity freshness.
Command
Get the last error that occurred. Errors are automatically written to lasterror.json and pending Agent requests are failed when ServiceNow returns an error.
Command
Get available parent records for reference fields. Use this to find existing REST API services, tables, etc.
Command
Fetch a single record by table + sysid. Cheaper and simpler than queryrecords when you already know the sysid (e.g. to confirm a write).