Contact Us 1-800-596-4880

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 (2.5%) 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:

  1. Click the Build JSONPath Expression (2.5%) button.

  2. Click Import from file to explore and select a JSON file to open or paste the JSON directly in the textbox.

    The import file window of the JSONPath Expression Builder tool.
  3. Click Next.

  4. Click an object in the JSON panel to extract the object’s JSONPath Expression.

    The JSONPath Expression Builder tool.

    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.

  5. Click Next.

  6. You can set filters for the expression at this point. See Set Filters for a JSONPath Expression for details.

  7. 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 (2%) 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:

The JSONPath Expression Builder tool showing the filter screen.
1 Click on any array element ([*]) of the resulting expression.
2 Select the conditions for the filter.
3 Click the Add new filter (2.5%) button.