Forum Discussion
First, you'll need to convert the content returned from your API into something you can work with in jinja2.
When you use the Make a Request step from the Webhooks channel, one of the variables returned should be "Content".
You can convert that content into something usable by creating a new variable, and then applying the from_json filter.
{% set json_content=a.content | from_json %}
after you have converted the content from json, you can access the properties in the same way you would any other variable using jinja2 in Pipelines. For your purposes it would probably look like this:
{% set json_content=a.content | from_json %}
{{json_content.data[0].corelogicPropertyId}}
If you don't have to use OAuth authentication to access the API, I would recommend using the JSON Handler channel instead. It will make it a lot easier to work with the data, especially if need work with a response containing more than one record.
------------------------------
Justin Torrence
Quickbase Expert, Jaybird Technologies
jtorrence@jaybirdtechnologies.com
https://www.jaybirdtechnologies.com/#community-post
------------------------------
- DanaHauser3 years agoQrew CadetHi Justin,
Thanks for your reply. I'll try your suggestion and see what happens. I didn't use the Fetch JSON due to the OATH 2.0 I needed right off the bat. I explained it a little more in my reply to Mark below.
Thanks,
Dana
------------------------------
Dana Hauser
------------------------------- DanaHauser3 years agoQrew CadetJustin,
This makes total sense, but I'm not exactly sure where to put the jinja2 code?{% set json_content=a.content | from_json %}
{{json_content.data[0].corelogicPropertyId}}
Thanks again,
Dana
------------------------------
Dana Hauser
------------------------------- JustinTorrence3 years agoQrew Cadet
I think this is what will end up going in your URL field:{% set json_content=a.content | from_json %} https://property.corelogicapi.com/v2/properties/{{json_content.data[0].corelogicPropertyId}}/ownership
Basically, after you set your variable, you just replace <clip> with the template that returns the property id:
{{json_content.data[0].corelogicPropertyId}}
------------------------------
Justin Torrence
Quickbase Expert, Jaybird Technologies
jtorrence@jaybirdtechnologies.com
https://www.jaybirdtechnologies.com/#community-post
------------------------------