Question

running code on raw JSON while retaining other context

  • 24 August 2022
  • 1 reply
  • 129 views

We have a zap that’s making a callout to an API (which returns JSON) and we next need to parse the response via a  Code step.  We want to be able to parse the raw JSON, because the way Zapier is structuring the response as line items is proving to be problematic (it’s not handling leading or trailing nulls properly).

 

In looking at other posts, it seems like the recommended approach here is to make a separate webhook zap w/ Catch Raw Hook, and then sent the JSON to it via a Custom Request Webhook action, using Data Pass-Through.  For example: How to transform JSON response? | Zapier Community

 

However, my issue is that there is also data from previous steps in the original zap that need to be retained, because they’ll be needed for actions that follow the JSON parsing.  As far as I understand it, if I use Custom Request, the entire data payload will consist of the raw JSON from my API call.  So when using a 2-zap approach like this, how do I make sure other details besides the JSON make it into the Catch Raw Hook zap?

 

Thanks!


This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

1 reply

Userlevel 7
Badge +14

@Percolator Consulting 

Good question.

You can use a Code step to make an API request and handle the response in raw JSON.

https://zapier.com/apps/code/help