Query JSON

Note: We have made improvements to the Query JSON action. Query JSON actions must be replaced with the newer version. Read the FAQ.

Use the Query JSONaction A tool for building the processes, logic, and direction within workflows. to extract information from a JSON text string and store it in a variable A placeholder that stores changes each time the workflow runs, such as the information entered in a form, or the name of a file. You can also create variables to store information you use in the workflow, such as an email address..

Some third-party services send or return information in a JSON data structure. Before you can use the information in a workflow, you need to extract it into variables. You can use the Query JSON action to extract pieces of information into variables using JSON queries (also known as JSONPath expressions).

Before you start 

JSON query examples

Test your JSON expression

There is no standard implementation of JSON paths. To avoid having to re-run your workflow multiple times to test your JSON expression, you can use the expression checking tool provided by the Nintex Platform tools.

To check your expression:

  1. Navigate to https://jsontostring.com/.
  2. Paste your sample JSON in the converter and click Convert.
  3. In another tab, navigate to Nintex Platform tools
  4. In the query body template on the right-hand side of the page:
    1. Replace the "string" value next to "JSON" with the JSON string you converted in step 2.
    2. Replace the "string" value next to "JSONpath" with the JSON expression you want to test.
  5. Click Send API Request.
  6. Check the returned response.

Configure the Query JSON action

In the Designer page:

  1. Click the Integration action group in the action toolbox.

    or

    Find actions by browsing action groups or by typing an action name or function in the Search field at the top of the action toolbox.

  2. Drag the Query JSON action into the workflow.
    The Query JSON action should occur after the logic that stores the JSON data in a variable.
  3. Click the Query JSON action.
  4. For JSON source, select the variable containing the JSON data.

  5. For JSONPath expression, type or paste the JSON query.

    Note: Click Check Expression to quickly validate your JSONPath expressions in Nintex Platform API. This reduces the need to execute the workflow to validate expressions.

  6. For Store first result, select a variable to store the first extracted value.

  7. For Store all results, select a collection variable to store a list of all extracted values.

For more information on the fields and buttons, see Query JSON fields.