records.update
The records.update: command updates a batch of records of the same type with the given fields.
start:
records.update:
output: updated_records
inputs:
record_type: task
record_ids:
- 123
- 456
- 789
# See: https://cerb.ai/docs/records/types/task/#records-api
fields:
importance: 90Every record gets the same values. Use record.update: in a repeat: loop when each record needs different ones.
Syntax
inputs:
| Key | |
|---|---|
record_type: |
The record type to update. |
record_ids: |
A list of record IDs of that type. |
fields: |
The fields to set on every record, based on the record type. |
disable_events@bool: |
Avoid triggering events for modified records. |
A batch of one ID behaves exactly like a single-record update.
An ID that doesn't exist is a harmless no-op. The records aren't loaded first – that's what makes this one statement rather than a loop – so a missing record isn't an error.
Unique fields
Fields that have to be unique across a record type can't be bulk updated, since the same value can't be unique on many rows at once. That covers a uri, an org or automation name, an address email, and anything else the record type validates as unique.
These fields are rejected rather than silently skipped, and they're left out of the editor's autocomplete suggestions for fields:.
output:
Save a summary of the batch to this placeholder.
| Key | |
|---|---|
record_type |
The context ID of the updated record type. |
record_ids |
The list of IDs that were updated. |
count |
How many IDs were in the batch. |
on_simulate:
The commands to run during simulation instead of updating the records.
If omitted, the records are updated during simulation.
on_success:
The commands to run on success.
on_error:
The commands to run on failure. If omitted, the automation exits in the error state.
The output: placeholder receives a dictionary with these keys:
| Key | |
|---|---|
error |
The error message. |
Policies
An automation policy has to allow records.update by name. There's no fallback to a record.update grant – an automation permitted to update one record at a time isn't thereby permitted to rewrite a thousand:
commands:
records.update:
deny/tasksOnly@bool: {{inputs.record_type is not record type ('task')}}
allow@bool: yesWorkers still need the appropriate update permission for every target record, exactly as they would updating them one at a time.
Extending bulk updates
The record.bulkUpdate trigger is the other half of this: it adds custom actions to the Bulk Update popup on a worklist, and runs an automation for each batch of records the worker selected.