Using JSONPAth to access returned data

Table of Contents

Some actions (or parameters) will return data that can be used in subsequent actions. In many cases this data will come in the form of an array or an object. To make it possible to pick out the desired data element from a piece of returned data, WunderAutomation uses JSONPath syntax.

JSONPath is a standard syntax that makes it possible to pick out a single element from a complex structure. Let’s assume you have an action that calls a remote API that in turn gives the following JSON structure:

If you’re interested in using the “id” value of this structure, you can get to it using a JSONPath expression:

result.id

NOTE: Normally in JSONPath, the above expression would be written as “$.result.id”, but when working with JSONPath expressions in WunderAutomation you can skip the opening “$.”.

JSONPath also works for a lot more complex situations. Given the JSON data:

The following JSONPath expression would return the string “next item”:

result.rows[1].item

Return data from actions #

The following built in actions return data:

ActionReturn data placeholderDescription
Webhookwebhook.responseData returned will be parsed as JSON string and made available as an array / object
REST API Callrest.responseData returned will be parsed as JSON string and made available as an array / object

Powered by BetterDocs

Leave a Reply

Your email address will not be published. Required fields are marked *