Skip to main content
Question

How to extract nested loop data from webhook?

  • February 23, 2022
  • 4 replies
  • 129 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

 

Did this topic help you find an answer to your question?
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

Troy Tessalone
Forum|alt.badge.img+14
  • Zapier Expert
  • 30996 replies
  • February 23, 2022

Hi @HubDoPete 

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


  • Author
  • Beginner
  • 2 replies
  • February 23, 2022

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?

 


Troy Tessalone
Forum|alt.badge.img+14
  • Zapier Expert
  • 30996 replies
  • February 23, 2022

@HubDoPete 

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


  • Author
  • Beginner
  • 2 replies
  • February 23, 2022
Troy Tessalone wrote:

@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