website logo
👥 Community🎯 Samples on GitHub🚦System Status
💡 Guides
🚀 Examples
🍕 Developer Reference
⚡️ Changelog
🎥 Video Library
Navigate through spaces
⌘K
Examples Overview
Setting up your solution
Jig Types
Components
Datasource
Actions
Preview
Widgets
Expressions
Aggregation
Boolean
Comparison Operators
Date & Time
Path Operators
Functional Programming
Jigx Variables
Predicate Queries
String
Docs powered by
Archbee
Actions

execute-entities

7min

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:

  1. Under action button
  2. In action list
  3. In onPress/onChange events (if the component has these options)
  4. In onRefresh/onFocus

Examples and code snippets 

Execute-entities in action

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

execute-entities-action
|
actions:
  - children:
    - type: action.execute-entity
      options:
        title: Add user
        provider: DATA_PROVIDER_DYNAMIC
        method: create
        entity: default/form
        data:
          firstname: =@ctx.datasources.employee-detail-dynamic.firstname
          lastname: =@ctx.datasources.employee-detail-dynamic.lastname


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-entity
              options:
                provider: DATA_PROVIDER_DYNAMIC
                method: create
                entity: default/form
                data:
                  firstname: =@ctx.datasources.employee-detail-dynamic.firstname
                  lastname: =@ctx.datasources.employee-detail-dynamic.lastname
            - type: action.go-to
              options:
                linkTo: ja-execute-entity-onPress


Execute-entities in onPress/onChange event

Here is the example of execute-entity 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
onChange
|
onPress: 
  type: action.execute-entity
  options:
      provider: DATA_PROVIDER_LOCAL
      method: update
      goBack: stay
      entity: default/employees
      data: 
        id: =@ctx.current.item.id
        modify: =($number(@ctx.current.item.modify) + 1) 




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



execute-entities-onRefresh
execute-entities-onFocus
|
onFocus: 
  type: action.execute-entities
  options:
    provider: DATA_PROVIDER_LOCAL
    method: update
    goBack: stay
    entity: default/employees
    data: =@ctx.datasources.employee-detail-dynamic.{'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: =@ctx.datasources.employee.{"id" :id}[]


See also

  • Developer reference



Updated 19 Sep 2023
Did this page help you?
PREVIOUS
confirm
NEXT
execute-entity
Docs powered by
Archbee
TABLE OF CONTENTS
Configuration options
Examples and code snippets
Execute-entities in action
Execute-entities in action list
Execute-entities in onPress/onChange event
Execute-entities in onRefresh/onFocus
Deleting multiple data records using execute-entities
See also
Docs powered by
Archbee
Copyright © 2023 Jigx, Inc. All rights reserved. Terms of Service