DataLab actions
An action runs server side against everything a query matches, so nothing is transferred to change it. Build the selection as on the DataLab queries page, then call one of the run_action_* methods on it.
Every action answers with a Pending Action rather than a result. DataLabBuilder.action_id reads its ID out of the response, and PendingAction.on_completion waits for it.
Action: Set attribute value
Action: Update Tags
Action: Create Entity Attachments
Attaches one already uploaded Client File to every matching Entity.
Action: Export JSON
The file lands in the account's temporary store. Its name and url arrive on the finished Pending Action.
Action: Export CSV
The formats are export-csv, export-xlsx, export-json and export-nsx. Each takes a different subset of the settings, and one that would be ignored is refused rather than read as a filter that is quietly not applied.
Action: Delete Entities
Action: Data Transformation
Moves Entities to another Entity Type, either wholesale or split by the value of an attribute.
Anything else
run_action sends an action body as given, for anything the named helpers do not cover yet.
Things worth knowing
An action runs against the whole selection. There is no page size and no partial run, so a mistake in a criterion is a mistake applied to every match. count costs nothing and is worth calling first.
A failed job does not raise. on_completion returns on FAILED and CANCELLED as well as success, because the messages explaining why are what you usually want. Check Status to tell them apart.
Changing what you are also reading. An action that changes an attribute the query filters on changes what the query matches. Read every page first if you need both.