execute-entity
Execute-entity can save, update, or delete data in a single row from a database, depending on the chosen method. Each datasource type (Dynamic / SQL / REST) will have a different syntax for updating, saving, and deleting data.
For the Dynamic datasource, values will be saved under the data option. For SQL/REST datasource, values will be saved under the Parameters option.
Configuration options
An execute-entity action can be used in multiple areas:
Under the action button
In action list
In onPress/onChange events (if the component you are setting up has these options)
In onRefresh/onFocus
Some properties are common to all actions, see Common action properties for the list of actions and their configuration options.
Offline remote data handling
Dealing with offline remote data ensures consistent synchronization with the remote data source. It also lets users continue working without a connection. Offline remote data handling explains the queueOperation property and provides examples.
Group queued commands
Use batchId to group related queued writes. Group commands in the offline command queue. Commands sharing a batchId are processed top-to-bottom; if one fails, the remaining members of the batch are paused until the failed command is retried or deleted.
If a sync or parallel command fails, later commands in that batch pause. Retry or delete the failed command before continuing the batch. Failed async commands do not pause their batch.
Use processingType to control how the command is processed in the queue.
sync
Runs one command at a time. This is the default.
parallel
Starts with adjacent parallel commands. The next sync command waits for all of them.
async
Starts without waiting. Later commands can run immediately.
Omit both properties to retain the existing serial queue behavior.
File uploads use async processing
For Dynamic Data create, save, and update commands with a file, processingType defaults to async. The queue starts the upload and continues with later commands.
Set processingType to sync or parallel when your workflow requires ordering. An explicit value always overrides the file-upload default.
retry-queue-command and delete-queue-command accept batchId as well as id, to act on a whole batch at once, plus an optional force (default false) needed to touch in-flight (starting/processing) rows, otherwise those are skipped.
The example groups related updates under employee-update-41. It sends two file updates concurrently. It then waits before updating the employee record.
Examples and code snippets
Execute-entity in action

In this example, execute entity is used in action with the create method. This example results in creating a new record with the First name, Last name, Email, and Phone number information. Execute entity is called by the press of the Save details button on the bottom.
Example: See the full example of execute-entity in GitHub.
Execute-entity in action list

By pressing the Save details button the execute-entity action will be followed by the go-to action.
Examples: See the full example of execute-entity in GitHub.
Execute-entity in onPress/onChange event

Execute-entity in onRefresh/onFocus

Deleting data using execute-entity
Here is an example of deleting different data using execute-entity. There are always 2 options for how you can delete a record:
Using SQL Select
Using JSONata function
In the first two examples, you can see the same situation where you are deleting all the records where the name equals Jane.
The third example shows how to delete the first 3 records from your datasource.
Last updated
Was this helpful?