Besvart

How do I access JSON values from an http request field?

I want to use an http request field and then fill in other fields with values from the response.   The API sends the response as a JSON object.

  • You should be able to create a text field with a dynamic link to the API field.  As noted the API field will return a TEXT response, so if there is specific data you need you will need to parse the field.


    1 person liker dette
  • You can add a text field that references the API field, just be aware it returns a PLAIN TEXT response, so you may need to parse it to have useable data.


    1 person liker dette
  • Thank you, this lets me see the response.
    Do you know how I would parse this?  I want to fill a field with just one of the values from the json

  • Yep... you can use the JSONVAL command


    JSONVAL({{fieldwithJSONresponse}}, 'JSONfieldyouwant')


    ie... if you response is


    {"access_token":"123456789","token_type":"Bearer","expires_in":"3599"}


    and you want the access token


    JSONVAL({{JSONRESPONSE}}, 'access_token')


    Hope this helps


    1 person liker dette
  • Hi Sonny,

    Jamie is spot on. Take a look at our Knowledge Base article covering the REST Field Type.

    -Support

Logg inn eller Registrér publiser en kommentar