My data comes in via a webhook and is formatted as shown below. When I attempt to loop through the line items I am only getting the first line item. What step am I missing to be able to go through these line items? Specifically I am trying to add records to a Google Sheet and Airtable base, but I can handle those action steps just fine as long as I can get the results for all line items.
Again, what step am I missing to be able to go through these line items?
Page 1 / 1
Hi @rmwarner
Even though the field names say “Line Items”, the data is not actually structured as Line Items.
Each field is its own variable.
If you have control over how the data is being sent to the webhook, then that may be the best place to fix the issue with the structure of the data to be an array.
Since it’s likely there can be N line items, you may have to get the RAW webhook data payload, then use a Code step to create arrays, to then use in the Looping app.
The good news is that I am the one who structures the payload being sent. The interesting thing is that when I look at what is actually being sent, the JSON does actually reflect that it is an array, so I’m not entirely sure where the disconnect is…
For what it’s worth, when I catch the same Webhook in Make.com, it does show up as an array, as I expect to…
@rmwarner
We would need to see screenshots with how the Zap webhook trigger step is configured and how the webhook is configured in the source app to have more context.
@Troy Tessalone - Figured it out! I was able to simply add a header from my source to help Zapier know how the data was formatted and we’re all good to go now. Thanks for your help.