execute-entities

Execute-entities is used to modify, create, and delete multiple rows in a specific table in a database.

Configuration options

An execute-entities action can be used in multiple areas:

  1. Under action button

  2. In action list

  3. In onPress/onChange events (if the component has these options)

  4. 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-back

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

Execute entities
Execute entities

Example: See the full example of execute-entities as an action in GitHub.

execute-entities-action
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.

execute-entities-action-list
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-onPress

Execute-entities in onPress/onChange event

Here is the example of execute-entities in onPress/onChange event in list-item.

Execute-entities
Execute-entities

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) 

Execute-entities in onRefresh/onFocus

Execute-entites
Execute-entites

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}

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.

This code example is not in the jigx.samples solution in GitHub.

Example:

Execute-entities-multiple
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.

This code example is not in the jigx.samples solution in GitHub.

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?