Automation API
clear_record_collection
Use this action to empty a record collection from an earlier action.
Tip
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 Clear 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
An earlier action collected job candidates from database app 100. This action empties that collection:
{
"type": "clear_record_collection",
"config": {
"record_collection": { "kind": "variable", "source": "action", "action_type": "record_collection", "app_id": 100 }
}
}
Config
| Property | Type | Description | Example value |
|---|---|---|---|
record_collection | reference | Required. The collection to empty, 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": 100 } |
General behavior
record_collectionis the only key. It has no default.- Without
record_collection, Tape saves the action, and validation reportsaction_invalid. - A
record_collectionwithout a matching earlier action fails validation withaction_variable_missing. - Reference a collection from a collect action, not a single field value.
- Later actions that reference the same collection get an empty list.
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.