Forum Discussion

NickGreen's avatar
NickGreen
Qrew Member
14 days ago
Solved

Pipeline Make Request - Return Make Request JSON Output into fields

** Update:
I managed to retrieve the ticket ID by using {{c.json.ticket.id}}
The only one which remains is to do the same for the users, though that is not reading the value when formatting the jinja the same as the ticket request, even though the structure of the .json is the same.

Hi Everyone,

I have a Make Request, which has an endpoint which is pointing to our Zendesk instance: https://instance.zendesk.com/api/v2/users/search.json?query=email:{{a.email}}

As you can see above, I am using the email address which is stored in the record field a.email - this checks if this end-user exists on Zendesk.

After running the pipeline, it returns the following in the Output (I've redated extraneous data)

{
"users":[
{"id":13617301225116,
"url":"https://instance.zendesk.com/api/v2/users/13617301225116.json",
"name":"Nick Green",
"email":"redacted@gmail.com"
]}
extra data redacted
}

In the above users array it has the "id":13617301225116 value which I would like to send back to the Quickbase record to populate a text field by using an Update Record action in the pipeline.

I use jinja in an attempt to extract the specific value: {{c.content.users.id}} - however this returns a null value.

When sending the entire output to the field by just using {{c.content}} I get the proper json structure, though for some reason it seems that jinja is not parsing the returned output to extract the "id" value.

Using {{c.content.users.id | tojson}} doesn't work and returns an error:
Validation error: Incorrect template "{{c.content.users.id|tojson}}". TypeError: Undefined is not JSON serializable

I also checked in with ChatGPT and it recommends using {{c.content.users.id}}

Has anyone been able to successfully do the above?

Cheers,
Nick

  • The data is generally stored inside c.body_params or sometimes c.body_json , you can post your entire log , then it would be easier to make out

    To access the data inside the array , assuming only 1 value is coming you need to do access object inside index[0] ->
    c.body_params.users[0].id or
    c.body_json.users[0].id 

    You can post your json here
    https://www.site24x7.com/tools/jsonpath-finder-validator.html


2 Replies

  • The data is generally stored inside c.body_params or sometimes c.body_json , you can post your entire log , then it would be easier to make out

    To access the data inside the array , assuming only 1 value is coming you need to do access object inside index[0] ->
    c.body_params.users[0].id or
    c.body_json.users[0].id 

    You can post your json here
    https://www.site24x7.com/tools/jsonpath-finder-validator.html


    • NickGreen's avatar
      NickGreen
      Qrew Member

      Hiya Prashant,

      Thank you very much for your time.
      Your solution was perfect, thank you!

      I used c.body_json.users[0].id - and this is returning the id perfectly.

      Now I am able to extract all of the information that I require.

      Keep well,
      Nick