Query Update Records
query_update_recordsFind records by encoded query and update them with specified fields. Use dry-run to preview affected count before confirming changes.
Instructions
Find records matching an encoded query and update them all with the specified data. Supports a dry-run mode: set confirm=false (the default) to see how many records would be affected WITHOUT making changes, then set confirm=true to execute.
IMPORTANT: When confirm=true, this modifies records on the ServiceNow instance. Always run a dry-run first to verify the match count before committing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| instance | No | The ServiceNow instance auth alias (e.g., "myinstance", "prod"). If not provided, falls back to the SN_AUTH_ALIAS environment variable. | |
| table | Yes | The ServiceNow table to update records on (e.g., "incident", "sys_user"). | |
| query | Yes | An encoded query string to find records to update. Examples: "active=true^priority=5", "state=1^assignment_group=NULL". | |
| data | Yes | Field values to set on all matching records (e.g., {"priority": "3", "state": "2"}). | |
| confirm | No | When false (default), performs a dry-run that returns the match count without making changes. Set to true to actually execute the updates. | |
| limit | No | Maximum number of records to update. If omitted, updates all matches. |