Skip to content

Jpath Iterator

Element name: Jpath IteratorCategory: Programming

Description: Advanced functionality that allows iterating through arrays and elements contained within objects in a JSON structure.

Functionality: Allows iteration over a case, from a JSON array. It uses the properties of the object as entities in each iteration.

Action Configuration Fields

[Name]: Unique configuration box descriptor for identification purposes in the flow.

[Entity containing the array]: Required field of type string, where the entity containing the array to be used for information extraction must be selected.

This should only be composed of the array element from the JSON.

  • Example:

The defined entity must contain a JsonArray structure: [ { “elemt1”: “value1” , “elemt2”: “value2” , “elemt3”: “value3”
} ]

[Case to iterate]: Selection of case that will be used to process multiple elements of the array. The case will be iterated as many times as there are elements in the array.

Example: Iteration_case

[Error Handler]: Selection box to identify the intention that will be activated in case of an error in the "Force case execution" action. When an error overflow occurs, the JPath_Iterator_Error entity will be loaded with the error details if it is available.

Jpath Iterator Implementation Example

  • Input:

In this case, 3 elements are identified in the array.

[Entity containing the JSON array]:

ArrayEntity <--

[
    {
    "name": "Molecule Man",
    "age": 29,
    "secretIdentity": "Dan Jukes",
    "powers": 
    [
        "Radiation resistance",
        "Turning tiny",
        "Radiation blast"
    ]
    },
    {
    "name": "Madame Uppercut",
    "age": 39,
    "secretIdentity": "Jane Wilson",
    "powers": 
    [
        "Million tonne punch",
        "Damage resistance",
        "Superhuman reflexes"
    ]
    },
    {
    "name": "Eternal Flame",
    "age": 1000000,
    "secretIdentity": "Unknown",
    "powers": 
    [
        "Immortality",
        "Heat Immunity",
        "Inferno",
        "Teleportation",
        "Interdimensional travel"
    ]
    }
]

[Case to iterate]: SuperHero_case

  • Process and output:

Using a reference of an array with 3 elements, the case will be executed 3 consecutive times, and each time the exploration entities will be loaded with the corresponding values for each element.

Element 1 (iteration 1):

{
  "name": "Molecule Man",
  "age": 29,
  "secretIdentity": "Dan Jukes",
  "powers": [
    "Radiation resistance",
    "Turning tiny",
    "Radiation blast"
  ]
},

Entities:

name <-- Molecule Man

age <-- 29

secretIdentity <-- Dan Jukes

Powers <--> [ "Radiation resistance", "Turning tiny", "Radiation blast" ]

Element 2 (iteration 2): { "name": "Madame Uppercut", "age": 39, "secretIdentity": "Jane Wilson", "powers": [ "Million tonne punch", "Damage resistance", "Superhuman reflexes" ] }

Entities:

name <- Madame Uppercut

age <- 39

secretIdentity <- Jane Wilson

Powers <- [ "Million tonne punch", "Damage resistance", "Superhuman reflexes" ]

And similarly, the third element of the array is traversed.

Advanced Functions: Not declared