Upsert ServiceNow record
servicenow_upsert_recordCreate or update one ServiceNow record matched by exact field/value pairs. Ambiguous keys are refused, and stale plans are detected for safe writes.
Instructions
Create or update one record matched by an exact key of field/value pairs: no match creates, one updates, several are refused (AMBIGUOUS_KEY). Pass the plan's expected_action / expected_sys_id with apply:true; a changed decision gives STALE_RECORD.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | Field/value pairs identifying the record, matched on raw values ('' matches an empty field); no '^' in values. | |
| apply | No | true executes; omitted: a non-mutating plan preview (SN_WRITE_MODE=apply executes by default). | |
| table | Yes | Table name, e.g. 'cmdb_ci_server'. | |
| values | Yes | Fields to write (plus the key fields on create). | |
| instance | No | Profile (default active) | |
| update_set | No | Update set (sys_id or exact name, in progress) to record the write in; switched for it, then restored. Default SN_UPDATE_SET, else unchanged. Data-row tables are not captured. | |
| expected_action | No | The plan's action; with apply, refused (STALE_RECORD) if the key now resolves differently. | |
| expected_sys_id | No | The plan's sys_id; with apply, refused (STALE_RECORD) if the key now matches another record or none. | |
| inputDisplayValue | No | Values are display values the instance resolves (sysparm_input_display_value); default false: raw. |