sndev.io / docs

batch-update

Batch-update records matching a query.

The batch-update command applies field values from a CSV or JSON file to all records matching an encoded query. Each row must include a sys_id column to identify the target record.
sn batch-update <table> <query> <file> [--dry-run]

Batch-update records matching a query.

Arguments

NameRequiredDescription
tableYesThe table to update.
queryYesEncoded query to filter target records.
fileYesPath to a .csv or .json file with field values.

Flags

FlagDefaultDescription
--dry-runPreview changes without applying them.

Examples

sn batch-update cmdb_ci_server "environment=production" updates.csv
Batch updating cmdb_ci_server...
✓ Updated 12/12 records
Done (1.8s)