- 3 minutes to read

Formula - jsonpath

Easily extract values from JSON messages using the Nodinite jsonpath Formula plugin. This page shows you how to use JSONPath expressions to retrieve data from message content, context values, or results from other formulas for your integrations.

✅ Extract data from any JSON structure with a single formula
✅ Use flexible JSONPath expressions for precise data selection
✅ See clear, real-world examples with input, formula, and result


What does the jsonpath Formula do?

The jsonpath('Expression', Content) Formula function extracts data from JSON structures by navigating to specific elements using standard JSONPath syntax. You can use this function on message bodies, context values, or results from other formulas.


Example 1: Extracting a Value from Message Body

Input from Body

{"seq":2}

Formula Expression

jsonpath('seq', body)

Result

2

Example 2: Extracting Multiple Values from JSON Body

Suppose your message body contains multiple elements.

Input

{"Seq":2, "Other":5}

Formula Expression

jsonpath('Seq', body)

Result

2

JsonPath Simple Parameter
Example: Extracting a value from JSON body using jsonpath

Multiple values from the Body
Example: Extracting multiple values from JSON body


Example 3: Extracting from Message Context

Suppose you have a message context value with the key id containing JSON content.

Input

{"Seq":2}

Formula Expression

jsonpath('Seq', context('id'))

Result

2

JsonPath Simple Parameter MessageContext
Example: Extracting a value from message context using jsonpath


Example 4: Extracting from Multiple Context Keys

Suppose you have multiple context keys, each with a JSON array.

Input

[{ "Id": 0 },{ "Id": 1 },{ "Id": 1 },{ "Id": 2 }]
[{ "Id": 3 },{ "Id": 4 },{ "Id": 5 },{ "Id": 6 }]

Formula Expression

jsonpath('$..Id', context(regex('id.*')))

Result

0
1
2
3
4
5
6

JsonPath Message Context Multiples
Example: Extracting multiple values from multiple context keys using jsonpath


Features

  • Extract data from any JSON structure using JSONPath
  • Use standard JSONPath expressions for flexible data selection
  • Works with message body, context, or results from other Formula functions
  • Ensures data integrity across integrated systems

Important

The jsonpath plugin loads the entire message into RAM. Only use this function on small messages to avoid performance issues.


How to use the jsonpath Formula

  1. Select Formula as the expression type plugin.
  2. Enter your jsonpath expression in the 'Expression' text area.
  3. Provide a JSON string as the Content parameter (e.g., message body, Context, or another formula result).

Syntax

  • Extract from message body:
    jsonpath('Expression', body)
  • Extract from message context:
    jsonpath('Expression', context('MessageContextKey'))
  • Extract from another formula:
    jsonpath('Expression', SomeOtherNestedFormulaFunction(Content))

Next Step

How to Add or manage Search Fields
How to Add or manage Log Views