Building JSONPath Expressions
JSONPath expressions navigate through a JSON structure in a similar way that XPath expressions reference parts of an XML document.
To simplify the process of creating JSONPath expressions, use the JSONPath Expression Builder included in RPA Builder. Open this tool by clicking () in the top menu bar or inside Action Steps that support JSONPath expressions (JSON Query, REST Call, and AWS Action Steps).
Opening the JSONPath Expression Builder from the top menu bar enables you to copy the resulting JSONPath expression for further use, instead of assigning it directly within an Action Step.
Build an Expression Using the JSONPath Expression Builder
To create a JSONPath expression using the JSONPath Expression Builder:
-
Click the Build JSONPath Expression () button.
-
Click Import from file to explore and select a JSON file to open or paste the JSON directly in the textbox.
-
Click Next.
-
Click an object in the JSON panel to extract the object’s JSONPath Expression.
After clicking a JSON element, the Result panel updates to show what values the expression extracts and the JSONPath expression field updates to show the expression built to extract the specified value.
-
Click Next.
-
You can set filters for the expression at this point. See Set Filters for a JSONPath Expression for details.
-
Click Apply to confirm and use the built JSONPath expression in the current action step.
Optionally, you can click the Copy JsonPath expression to clipboard () button to copy the expression.
For more information about JSONPath, see XPath for JSON.
Set Filters for a JSONPath Expression
During the last step of creating a JSONPath expression, you can set filters by specifying the conditions before applying the expression created using the builder:
1 | Click on any array element ([*] ) of the resulting expression. |
2 | Select the conditions for the filter. |
3 | Click the Add new filter () button. |