Formula - JsonPathKey
Easily extract keys or paths from JSON messages using the Nodinite JsonPathKey
Formula plugin. This page shows you how to use regular expressions and JSONPath to retrieve matching keys or paths from message content, context values, or results from other formulas for your integrations.
✅ Extract keys or paths from any JSON structure with a single formula
✅ Use flexible regular expressions and JSONPath for precise selection
✅ See clear, real-world examples with input, formula, and result
What does the JsonPathKey Formula do?
The JsonPathKey('Expression', Content)
Formula function extracts all keys or paths from a JSON structure that match a given regular expression or JSONPath. You can use this function on message bodies, context values, or results from other formulas.
Example 1: Extracting Paths from JSON Body
Input from Body
{"swagger":"2.0","info":{"version":"V1","title":"Nodinite WebAPI","x-swagger-net-version":"8.3.38.001"},"host":"localhost","basePath":"/Nodinite/Dev/WebAPI","schemes":["http"],"paths":{"/api/activedirectorygroups":{"get":{"tags":["ActiveDirectoryGroups"],"summary":"Get a list of Active Directory Groups, limited by specified input","operationId":"ActiveDirectoryGroups_List","consumes":[],"produces":["application/json","text/json"],"parameters":...}}
Formula Expression
JsonPathKey('$.paths.*', body)
Result
/api/activedirectorygroups
/api/activedirectorygroups/{id}
/api/activedirectorygroups/{id}/isnameavailable
...
Example: Extracting matching paths from JSON body using JsonPathKey
Features
- Extract keys or paths using a regular expression or JSONPath from JSON content
- Works with message body, Context, or results from other Formula functions
- Ensures data integrity across integrated systems
Important
The JsonPathKey plugin loads the entire message into RAM. Only use this function on small messages to avoid performance issues.
How to use the JsonPathKey Formula
- Select Formula as the expression type plugin.
- Enter your JsonPathKey expression in the 'Expression' text area.
- Provide a JSON string as the Content parameter (e.g., message body, context value, or another formula result).
Syntax
- Extract from message body:
JsonPathKey('Expression', body)
- Extract from message context:
JsonPathKey('Expression', context('MessageContextKey'))
- Extract from another formula:
JsonPathKey('Expression', SomeOtherNestedFormulaFunction(Content))
Next Step
- RegEx
How to Add or manage Search Fields
How to Add or manage Log Views
Related Topics
- Body – Extract body from the Log Event
- Expression Type Plugins are used in Search Fields
- What are Search Fields?
- What are Search Field Expressions?
- What are Message Types?
- What are Log Views?