collected_records_update
Use this action to update every record in a collection that an earlier action built.
Read the live config shape of each action type from GET /v1/automation/meta/action before you build on it.
In the automation editor, this action is Update all collected records in the Record collections family. Its group is action, and it works with every trigger but needs an earlier action that creates the record collection.
Send it in the actions array of Create an automation or Update an automation. An update replaces the whole array, so include the other actions.
Example
This action marks every collected task as ready for review:
{
"type": "collected_records_update",
"config": {
"record_collection": { "kind": "variable", "source": "action", "action_type": "record_collection", "app_id": 5 },
"field_assignments": [
{
"field_type": "single_text",
"variable_def": { "kind": "variable", "source": "field", "field_id": 4021, "field_type": "single_text", "previous": false, "collection": false, "triggering": false },
"assignment_type": "set",
"field_value": ["Ready for review"]
}
],
"silent": true
}
}
Config
| Property | Type | Description | Example value |
|---|---|---|---|
record_collection | reference | Required. The collection to update, created by an earlier action. The schema lets you save without it, but validation then reports action_invalid. | { "kind": "variable", "source": "action", "action_type": "record_collection", "app_id": 5 } |
field_assignments | array of field assignments | The values to set on each collected record, one entry per field. Empty when left out. See Field assignments. | [] |
author_id | integer | reference | User Tape attributes the change to: a user ID, or a reference to the creator, the last modifier or a user field. Left out, the automation itself is the author. | 812 |
trigger_webhooks | boolean | Whether the change fires outbound webhooks. Default false. | false |
trigger_other_flows | boolean | Whether the change starts other automations. Default false. | false |
silent | boolean | Whether Tape sends no notifications for the change. Default false. | true |
To find the field IDs, see App and field IDs.
author_id, trigger_webhooks, trigger_other_flows and silent are shared by every action that changes records. In the action menu of the automation editor, they are Author, Trigger webhooks, Trigger automations and Silent. To find a user ID for author_id, see Retrieve organization users.
Field assignments
Each entry in field_assignments sets one field on every collected record.
field_typetells the 20 field-type shapes apart, for examplesingle_textornumber.variable_defis a reference to the target field.assignment_typepicks how Tape produces the value.setusesfield_value,set_codeusescode.
meta/action describes the populated shape only loosely. Copy the shapes from current_record_update and check the live config_schema before you send filled assignments.
General behavior
- No key is required by the schema. Without
record_collection, Tape saves the action, and validation reportsaction_invalid. - A
record_collectionwithout a matching earlier action fails validation withaction_variable_missing. Tape resolves the reference to the nearest earlier action that creates a collection for the sameapp_id. - Left out or
[],field_assignmentschanges no field value. The action still logs asuccessstep for each collected record. - On an empty collection, the action changes nothing and logs one
successstep with the messageNo records were found in the collection. - Without
author_id, the automation itself is the author. A user ID that Tape can't find gives the broken reasonaction_user_missing. - Tape returns
silenton every read. It'sfalsewhen you left it out.
Requirements
- To add or change this action through the API, your token needs the
automations:editcapability. See Capabilities. - You must administer the workspace that the automation's database app belongs to.
- An earlier action in the automation must create the collection in
record_collection, for examplecollect_app_records.