Skip to content

JPath Evaluator

Nombre del elemento: Jpath Evaluator

Category: Programming

Description: JPath is a query language for JSON, similar to XPath for XML. JSONPath creates a standard and uniform syntax for defining different parts of a JSON document. JSONPath defines expressions to traverse a JSON document to reach a subset of the JSON.

Functionality: It allows extracting one of the keys from the JSON string result.

Action Configuration Fields

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

Control Flow Subset

[Entity containing the JSON document]: Required field of type list, in which the entity containing the string to be used for information extraction must be selected.

[Entity where the result of the query will be stored]: Required field of type list, in which the entity that will allow saving the result obtained in the extraction of the key must be selected.

[The query to be used to extract data from a JSON document obtained from an expression]: Required field of type string expression where the search expression on the resulting Json should be placed in single quotes.

[The intention to execute in case of error]: In case of an error, the action flow will be interrupted, and the exception description will be passed to the selected intent by name, basically referring to the intention to execute in case of an error which can be selected from the dropdown list, if your entity is not located, remember to create it beforehand.

Jpath Evaluator Implementation Example

  • Input:

[Entity containing the JSON document]: CLIMA

{
  "weather": 
  [
    {
        "id": 800,
        "main": "Clear",
        "description": "clear sky",
        "icon": "01d"
    }
  ],
  "timezone": -10800,
  "id": 3871336,
  "name": "Santiago",
  "cod": 200
}

[Entity where the result of the query will be stored]: Clima_Query

[The query to be used to extract data from a JSON document obtained from an expression]: '$.weather[0].main'

[The intention to execute in case of error]: Clima_Error

  • Output: Clima_Query --> Clear

Advanced Functions: Not declared.