sort_record_collection
Internal beta โ config shape is being migrated
The Automation API is an internal beta and is not released yet โ endpoints and payloads may change or be
withdrawn without notice. This action's config is being migrated to a typed schema; the fields below reflect that
in-progress shape. Always read the authoritative, live shape from
GET /v1/automation/meta/action before building against it.
Sort collection โ sorts the records in a record collection by one or more variables. group: "action". No specific trigger context is required.
Part of the Record collections family. This page
documents the typed config; for how an action sits inside an automation definition, see
Actions and Action examples.
Configโ
| Key | Type | Required | Description |
|---|---|---|---|
record_collection | reference | no | The record collection to sort โ an action-variable reference to a prior action's collection output. Omitted when unset. |
sorts | array of sort entries | no | Ordered list of sort entries applied to the collection. Empty when omitted. |
Each entry in sorts is an object:
| Key | Type | Required | Description |
|---|---|---|---|
id | string | no | Stable entry id; server-minted when omitted, and round-trips on read. |
variable_def | reference | yes | The variable to sort by โ a reference to one of the record collection's app fields (or a meta field). |
direction | enum | yes | Sort direction. |
direction tokens (lower-case): asc, desc.
Exampleโ
An action entry inside an automation definition's actions[]:
{
"type": "sort_record_collection",
"config": {
"record_collection": { "kind": "variable", "source": "action", "action_type": "record_collection", "app_id": 42 },
"sorts": [
{
"variable_def": { "kind": "variable", "source": "field", "field_id": 4055, "field_type": "single_text", "previous": false, "collection": true, "triggering": false },
"direction": "asc"
}
]
}
}
Validation & behaviorโ
- Both members are optional: an omitted
record_collectionis dropped, and an omittedsortsdefaults to the empty list[]. - Within each
sortsentry,variable_defanddirectionare required;idis server-minted when omitted and round-trips on a GETโPUT. - This is a consumer action โ its sort keys must reference a variable scoped to the collection being sorted (a record-collection app field or meta field).
- Sort entries are applied in the order given, so later entries act as tie-breakers for earlier ones.
See alsoโ
- Dynamic values โ template values and references
- Actions catalog ยท Record collections family
- Action examples