This activity allows you to easily extract information from a JSON-formatted string. Instead of having to use complicated regular expression to parse JSON, you can use a JSONPath to traverse the JSON’s structure and extract the data you want. These paths can be simple (
$.user.firstName) or complex (
$.users[?(@.firstName == 'John')].phoneNumbers.number).
- Check the
Continue Workflow Execution on Failurebox and use a
Condition Blockto check whether or not the path query was successful. This helps make sure your workflow fails with a useful error message and only continues if the path query succeeds.
- There are more than one implementation of JSONPath. SecureX orchestration uses the Jayway implementation.
- JSONPath Overview
- JSONPath Tester (More user friendly but uses a slightly different implementation of JSONPath)
- JSONPath Tester (Jayway) (Not as user friendly but uses the same implementation of JSONPath as SecureX)
The following sample workflows are available in our repository’s workflows folder to help you get familiar with this activity. These can be imported using the instructions here or you can view the workflow in GitHub by clicking on it.