JSON Array Workflow Action

Problem Description

Often, one is faced with the challenge of splitting a JSON array into its individual elements and storing them in the DataEngine as separate records to establish a one-to-many relationship between the current entry and the objects in the array. Similarly, it may be necessary to merge these records back into a JSON array and store them in a field to resynchronize them.

JSON Array Split

With each execution of this action, a JSON is read from a field, and for each object in this array, a record is created in the DataEngine and linked to the current entry. The following settings are relevant:

  • JSON Field: Select the field containing the JSON array.
  • Target Module: Choose the module for which new entries should be created.
  • Index Field: Required if the array is regularly updated and the associated entries need to be updated. If no index field is set, new records are created with each execution of the action. If an index field is selected, a corresponding mapping must also be created.
  • Mapping: Assign the key from the object on the left side to a field from the fields of the target module on the right side. By entering an example JSON and using the “Example JSON” button, mappings can be automatically created for each key.
  • Delete Related Records: Option to determine whether related records should be deleted when updating the arrays if they have been deleted from the JSON array.

JSON Array Join

With each execution of this action, all related records of the current record are converted into a JSON array of objects and written into a field. The following settings are relevant:

  • JSON Field: Select the field where the JSON array should be written.
  • Source Module: Choose the module from which the entries should be fetched.
  • Index Field (optional): If the JSON array should not be rewritten but existing entries should be updated, an index field must be selected. Again, a corresponding mapping is required.
  • Mapping: Assign the key from the object on the left side to a field from the fields of the source module on the right side. Here, too, a mapping can be quickly created by entering a sample JSON and using the “Example JSON” button.
  • Delete Related Records: Option to determine whether old entries in the JSON array should be retained or removed.

By configuring these actions clearly, it is possible to efficiently process and synchronize JSON data in the DataEngine, ensuring seamless integration and management.

Marini Systems GmbH | Contact SupportMarini Website | Privacy Statement | Legal