DataLab actions
A DataLab action is a server side job that runs against every Entity a DataLab selection finds. It lets you change, relate, export or delete records in bulk without paging through them yourself.
People configure actions on saved queries in Operator and run them from there. Every action starts a Pending Action, which reports progress and, for exports, the file to download.
This article will cover how to run an action and the settings of each action type. You can read about selections in DataLab queries, and about the actions that compare two selections in DataLab secondary queries.
Running an action
Send a "PrimarySelection" and an "Action", or the whole request as "UserSQL" text. To run several actions one after another under one Pending Action, send them as a list under "Actions". Check what an action will change by running its selection first.
Run a DataLab action
A request without a selection, without an action, or with an unknown or incomplete action fails straight away with a 400. Problems found while the job runs are reported on the Pending Action instead. Only "set-attribute", "relationship-map", "relationships-remove", "merge" and "save-secondary-items-count" take a secondary selection; the other actions fail when one is sent. You can read about following a Pending Action in Pending Actions.
Exports finish with a file. For CSV, XLSX and NSX the Pending Action's "Result" is the file's name. For JSON it is a JSON string holding "TempFile.ID", "FileName" and a download "URL". Download the file from the route below.
Download an exported file
Action: Set attribute
Writes one or more attribute values on every found Entity. Values are parsed by "AttributeType" before they are written, and a blank value clears the attribute. This page covers fixed values; copying values between two selections is on the secondary queries page.
Action: Tags
Adds, removes or replaces the Tags on every found Entity. Name Tags by ID, by name, or either; a name stands for every Tag carrying it, ignoring case. "set" with no Tags clears them. You can read about Tags in Tags.
Action: Tag mapping
Applies a saved Tag Mapping, which gives each Entity the Tag mapped to its attribute value. Tag Mappings are listed by "GET layerMappings".
Action: Attach a file
Attaches an existing file to every found Entity. The file is not copied, and an Entity that already has the file under the same Attachment Type has its group updated. You can read about attachments in Entity attachments.
Action: Data Transform
Runs a saved Data Transform over every found Entity. The mapping output is merged into each Entity, and the transform's "DestinationDataSchema" is added to the Data Schema of each Entity Type it changes. You can read about Data Transform records in Data Transforms.
Action: Generate descriptions
Writes an AI generated description to "Bruce/Description" on every found Entity, replacing an earlier generated one. Descriptions come from the installation's vision service and read each Entity's attributes and best LOD thumbnail. It has no settings.
Action: Entity Type mapping
Moves the found Entities to other Entity Types. There are three ways to choose the new type, tried in this order: one target type for all, a new type per value of an attribute, or a list mapping attribute values to types. Each move can apply a Data Mapping, which you can read about in Data Mapping.
Action: Remove duplicates
Groups the found Entities by a key attribute, compared without regard to case, and keeps the first of each group. The others are merged into it and deleted. The job stops if more than 10 Entities share a key, since that suggests the key is not unique enough.
Action: Delete Entities
Deletes every found Entity. Count the selection first.
Action: Delete relations
Deletes the relations of one Relation Type where a found Entity is the Principal. With a secondary selection it deletes only the relations between each primary Entity and its secondary matches, as the secondary queries page describes. You can read about relations in Entity relations.
Action: Export CSV and XLSX
Writes the found Entities to a CSV or Excel file. Without "ColumnSettings", the columns are the ID and every typed attribute in the Data Schema of "EntityTypeID". Without "EntityTypeID", the schemas of the Entity Types in the first page of matches are merged.
Action: Export JSON
Writes the found Entities, and the related records named in "Expand", to JSON files zipped together.
Action: Export NSX
Writes the found Entities, and the records they depend on, to a Nextspace exchange file for moving records between accounts.