Question

How to extract nested loop data from webhook?

  • 23 February 2022
  • 4 replies
  • 122 views

Hi folks,

I need to create multiple records from nested arrays in a web hook payload.

Initially will write them to a Google Sheet until we know it is valid and will write it to our CRM.

Trying to use Loop by Zapier which works great on a flat loop, but nested isn’t supported.

The data is for Products,

  • broken out into editions (e. gold, silver, bronze)
  • further divided into payment plans (monthly, yearly)
  • further divided into price breaks ( 1-100@$20ea, over 100@$15ea)

I need to create product record for every price break.

Webhook data comes in similar to this:

product:
name: Widgets
editions:
1:
Name: Bronze
Plans:
1:
frequency: monthly
costs:
1:
quantity: 1-12
price: 20
2:
quantity:12-24
price: 15
2:
frequency: yearly
costs:
1:
quantity: 1-500
price: 10
2:
quantity: 500-1000
price: 5
2:
Name: Silver
Plans:
1:
frequency: monthly
costs:
1:
quantity: 1-12
price: 30
2:
quantity:12-24
price: 25
2:
frequency: yearly
costs:
1:
quantity: 1-500
price: 20
2:
quantity: 500-1000
price: 15
3:
Name: Gold
Plans:
1:
frequency: monthly
costs:
1:
quantity: 1-12
price: 40
2:
quantity:12-24
price: 35
2:
frequency: yearly
costs:
1:
quantity: 1-500
price: 30
2:
quantity: 500-1000
price: 25

 


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

4 replies

Userlevel 7
Badge +14

Hi @HubDoPete 

You’ll likely need to use a custom Code step to handle the nested data structure: https://zapier.com/apps/code/help

Thanks @Troy Tessalone 

Yes that looks to be the best way, adding some javascript I guess.

It goes beyond my noCode level.

What’s a good way to engage a Zapier specialist to code this zap action for us?

 

Userlevel 7
Badge +14

@HubDoPete 

Check out the available Zapier Experts: https://zapier.com/experts

@HubDoPete

Check out the available Zapier Experts: https://zapier.com/experts

Thanks @Troy Tessalone I have completed the enquiry form to be matched with a specialist