execute-entities
Execute-entities is used to modify, create, and delete multiple rows in a specific table in a database.
Execute-entities can't be used if you're using Static Data.
Configuration options
An execute-entities action can be used in multiple areas:
Under action button
In action list
In onPress/onChange events (if the component has these options)
In onRefresh/onFocus
Reference data properties and values as a group
With the execute-entities action, you can reference data properties and values as a group instead of listing them individually to be saved or created. See the data-grouped example below:
actions:
- children:
- type: action.execute-entities
options:
title: Create Record(s)
provider: DATA_PROVIDER_DYNAMIC
entity: default/hikers
method: create
data: [email protected]
onSuccess:
type: action.go-backactions:
- children:
- type: action.execute-entities
options:
title: Create Record(s)
provider: DATA_PROVIDER_DYNAMIC
entity: default/hikers
method: create
goBack: previous
data:
contact: [email protected]
name: [email protected]
email: [email protected]
photo: [email protected]
participant-group: [email protected]Offline remote data handling
Dealing with offline remote data is fundamental to ensuring data synchronization and consistency between the mobile app and the remote data source, allowing users to continue using the app and performing actions without interruption. Offline remote data handling explains how to configure solutions to deal with data when the device is offline using the queueOperations property available in execute-entities, and provides examples and code samples.
Examples and code snippets
Execute-entities in action

Example: See the full example of execute-entities as an action in GitHub.
actions:
- children:
- type: action.execute-entities
options:
title: Add user
provider: DATA_PROVIDER_DYNAMIC
method: create
entity: default/form
data:
firstname: [email protected]
lastname: [email protected]Execute-entities in action list
Example: See the full example of execute-entities in an action list in GitHub.
actions:
- children:
- type: action.action-list
options:
isSequential: true
title: Add user
actions:
- type: action.execute-entities
options:
provider: DATA_PROVIDER_DYNAMIC
method: create
entity: default/form
data:
firstname: [email protected]
lastname: [email protected]
- type: action.info-modal
options:
modal:
title: User successfully added
buttonText: See user list
element:
type: icon
icon: add-circle-bold-alternate
color: element
onConfirmed:
type: action.go-to
options:
linkTo: execute-entities-onPressExecute-entities in onPress/onChange event
Here is the example of execute-entities in onPress/onChange event in list-item.
Example:
See the full example of execute-entities in action onPress in GitHub See the full example of execute-entities in action onChange in GitHub
onPress:
type: action.execute-entities
options:
provider: DATA_PROVIDER_LOCAL
method: update
entity: default/employees
data:
id: [email protected]
modify: =($number(@ctx.current.item.modify) + 1) onChange:
type: action.execute-entities
options:
provider: DATA_PROVIDER_LOCAL
method: update
entity: default/employees
data:
id: [email protected]
modify: =$number(@ctx.current.item.modify) + 1Execute-entities in onRefresh/onFocus
Example:
See the full example of execute-entities in onRefresh in GitHub. See the full example of execute-entities in onFocus in GitHub.
onRefresh:
type: action.execute-entities
options:
provider: DATA_PROVIDER_LOCAL
method: update
entity: default/employees
data: [email protected].{'id':id, 'modify':$number(modify)+1}onFocus:
type: action.execute-entities
options:
provider: DATA_PROVIDER_LOCAL
method: update
entity: default/employees
data: [email protected].{'id':id, 'modify':$number(modify)+1}Deleting multiple data records using execute-entities
To delete multiple data records in a Dynamic data table use the execute entities action with an expression as shown below.
Example:
actions:
- children:
- type: action.execute-entities
options:
title: Delete employees
provider: DATA_PROVIDER_DYNAMIC
entity: default/employees
method: delete
data: [email protected].{"id" :id}[]Updating multiple data records using execute-entities
To update multiple data records in a Dynamic data table use the execute entities action with an expression as shown below.
Example:
actions:
- children:
- type: action.execute-entities
options:
title: Update Records
provider: DATA_PROVIDER_DYNAMIC
entity: default/penguin_species
method: update
data: [email protected] ~> | $ | {"endangered":"Yes"} | Updating multiple data records in a single REST call
See Update multiple records in a single REST call for an example of using execute-entities with REST.
Last updated
Was this helpful?