[✅ Solution] Question about JSONata

Hello everyone!

I’m trying to understand exactly how to use the JSONata function and I have some questions. Please see my screenshot.

Based on my research, I believe you’re supposed to put a string inside the first set of parentheses containing your JSONata statement, then use .evaluate(). However, I’m not sure if the body for .evaluate() is supposed to contain a Javascript object or a JSON string.

I dropped the raw JSON into ChatGPT and the string in my screenshot is what it told me to use. However, I cannot get Tape to show any variable at all.

Can anyone recommend how to use JSONata to drill down into an array of fields of a Tape record, looking for a field with a given label or ID, and then get a value from the values?

Hi @andrew.cranston
Not sure if this gives you enough but:

jsonata('id').evaluate(var_http_response)

or

var_stop = jsonata('payload.stop').evaluate(webhook_payload_parsed)

Also handy site: JSONata Exerciser

2 Likes

Thanks @Jason for the idea! I’m not using a webhook so can’t use webhook_payload_parsed and ‘id’ is not enough information, but I found the answer.

I asked ChatGPT to feed me the right answer and it ALMOST got me there, but I had a fellow Podio partner help me and I needed to add a period just after the dollar sign.

So actually, the correct statement is:

$.data.fields[label='Member'].values.value.user_id

This worked for me. :slight_smile:

3 Likes

Having access to JSONata within Tape’s automation tool is SUCH a huge time saver!!

2 Likes