I’m trying to retrieve the values from events.payload.media.name
. I’m sending data to a Zapier webhook from a different application, and the Content-Type
is displayed as application/json
. When I validate the output, it confirms that it is in JSON format. Here is a sample JSON structure:
{
"hook":{
"uuid":"1asdfasd5-asdf-4f52-bd31-c7a544897808"
},
"events":[
{
"uuid":"0asdfasdfasdf0",
"type":"viewing_session.turnstile.converted",
"payload":{
"visitor":{
"id":"28b606b_7853753-3868-4f07-9543-70da084452cc-7442322af-407bdc31d8fc-2739"
},
"viewing_session":{
"id":"154284_b40c5358-1faf-40e9-a44e-60aa641a11cd-fd3c69d8d-302471c603f4-8245"
},
"media":{
"name":"this is what I want!"
}
},
"metadata":{
"account_id":"asdfasdfasdf"
},
"generated_at":"2017-05-02T07:31:08Z"
}
]
}
However, when I check the data type of the output, it shows as a string, which stops me from accessing it via the following code:
return {output: typeof dataObject.thing.events.payload.media.name};
I’m relatively new to this, so could I be overlooking something important here?