Variables in workflows

In Next Matter you can send data to an external application. You might then pull the processed data from these apps and re-use it in the workflow..

What is a variable

A variable is a value that changes depending on a context or situation. It might be a version number, a document ID, or a sum of a calculation pulled into a workflow from a 3rd party tool.

For example, you might want to create a Zendesk ticket directly from a Next Matter workflow and pull the ticket ID of this ticket back to the workflow for reference.

In Next Matter you can create variables in one of the two available ways

  • Selectable variables: you can select variables from the dropdown. This is possible in no-code steps, quick actions or when you start a workflow with a webhook trigger
  • "DIY" variables: you can run the integration step without variables, look at the response, and define the value you want to extract.

Select variables from response body

When you test a webhook, you call it and the call response is received from Next Matter. We parse the response for you and select data that can be reused.

Variables in no-code steps

You can add variables to your step configuration. Variables are chunks of data that we take from the Response of the step and turn into reusable items.

We extract the data chunks you can reuse for you.
To add variables, select them from the Select data to reuse drop-down and click + Add.


Tip: You can still add custom variables. Simply add a pre-defined one, clear the fields, and enter the desired variable.


For example, this is how you can add variables in the no-code Google Sheets integration:


Create a variable from scratch

  1. Create a step and select Integrations as the step type. You can add this step to an already existing workflow or create a new workflow. The integration step with a variable will be the step to which you want to send the variable data.
  2. Click the setting icon.
  3. Enter the API endpoint you will be calling. If unsure, check the third-party API documentation.
  4. If you've already integrated with an external tool, select this tool in Authorization.
  5. Click + Add a variable.
  6. Configure the variable:
  • Give your variable a meaningful name

📘

Make sure there are no brackets or braces in the variable name.

  • Click Test integration and copy the JSON response provided by the integration step request. Extract the variable from the response and use an online evaluator to test the required syntax for the variable https://jsonpath.com.

📘

Note thet Next Matter doesn't allow single quotes for numbers. For example, 124 is without quotes here: $.field[?(@.id==124)].value.

  • Copy the variable over to Next Matter.
  1. Save your changes.

Now you can reference the variable in the step where it should be used or displayed. You can select one of two available formats from the data reference dropdown.

  • Plain - useful if you want to display the result
  • JSON - useful if you want to use the result in another integration step

📘

If you're trying to extract data form a payload that has defined IDs, make sure the IDs are not wrapped in quotes in the final JSON path. For example \"process_step\":264733.

Null variables and conditions

Next Matter's API allows retrieving specific fields or actions in a workflow using JSONPath.

For example, if you use the endpoint GET /instances/{instance_id}/?inject_values=true to inject the field input values into the response, you can use the following JSONPath to parse the response and retrieve the input value of a form field:

$.process_snapshot.steps[?(@.id == <STEP_ID>)].actions[?(@.id == <FORM_FIELD_ID>)].value.inputValue

This JSON filters the step to find the specific form field and extracts its input value.


There are cases when the API response might return a null input value. If you want to activate the next step based on whether a variable is empty or null, you can configure the next step's condition accordingly. This setting will check for empty or null input.


or you can use the following JSONPath:

$.field[?(@.value == None)]