JSONPath Query
This activity allows you to extract information from a JSON-formatted string. Instead of having to use complicated regular expressions to parse a JSON, you can use a JSONPath to traverse the JSON’s structure and extract the data you want.
Best Practices
Check the Continue Workflow Execution on Failure check box and use a Condition Block to check whether the path query was successful. Fail the workflow if the extraction was unsuccessful. This helps make sure your workflow fails with a useful error message and only continues if the path query succeeds.
Note: There are multiple implementations of JSONPath. Automation uses the Jayway implementation.
Helpful Links
- 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 Cisco XDR)
Usage
Complete the following properties to use this activity:
- JSON Query
- Source JSON to Query - Paste the JSON content into the text box or click the Variable Reference icon to choose a variable.
- JSONPath Queries - Click Add and provide the following information:
- JSONPath Query - Enter the query or click the Variable Reference icon to use a variable.
- Property Name - Enter the name of the JSON property.
- Property Type - Click the drop-down menu and choose the type of property the query will search for.