Integration Engine Solutions to Connect Anything to Anything

Log out?

JSONPath Evaluation Processor

The JSONPath Evaluation Processor populates transaction and/or global attributes with the evaluations of JSONPath expressions.

Add JSON Path Evaluation Processor

Processor (Adapter) Configuration Drop-Down List

Select the JSONPath Evaluation tab and click on Add Processor.

 Add JSON Path Evaluation Processor in PilotFish

Click on Add Processor

Basic JSONPath Evaluation Processor Configuration Options

On the Basic tab you can set:

JSON Path Evaluation Processor Basic Configuration Options

JSONPath Evaluation Processor Basic Configuration Options

The JSONPath Evaluation processor parsing a JSON document in the transaction body and runs JSONPath evaluation strings against it.  The results from executing the JSONPath strings are populated in configured transaction attributes.  An example message below represents a list of items and a date in JSON:

{
    "date": "1-14-2022",
    "item": [
        {
            "name": "Potato",
            "price": 1.23,
        },
        {
            "name": "Taco",
            "price": 0.99,
        }
        {
            "name": "Burrito",
            "price": 4.99,
        }
        {
            "name": "Nachos",
            "price": 9.99,
        }
    ]
    }
}

To retrieve the date in the above document, the JSONPath would look as follows:

$.date

Where ‘$’ represents the root of the document and ‘.date’ represents the date key in which the value is to be retrieved from.  To grab a value deeper in the tree, you would simply append indexes and object keys as necessary.  For example, to retrieve a price from the above document, the JSONPath would look as follows:

$.item[0].price

This would return ‘1.23’.  The configuration of the above scenarios in the processor can be seen below.

JSON Path Processor (Adapter) Set Up Options

Processor Attributes Configuration Screen

When executed, you can see the results in your transaction attributes:

JSON transaction attribute example in PilotFish Platform

Transaction Attributes Example

If more than one result is returned or could potentially be returned, the resulting attribute value will be represented by a JSON array of values.

Additional documentation on how to create JSONPath queries can be found here.

Conditional Execution JSONPath Evaluation Processor Configuration Options

On the Conditional Execution tab, you can set additional Processor execution conditions. The transaction data dependent condition may be specified here as an enhanced expression. If this expression returns anything other than TRUE (ignore case) – this processor will be skipped. No additional configuration for this Processor is required.

JSON Path Processor Conditional Execution Options

Conditional Execution of the JSONPath Evaluation Processor

This is a unique website which will require a more modern browser to work! Please upgrade today!