Question

Creating parent/child records in MySQL

  • 25 February 2024
  • 1 reply
  • 30 views

Userlevel 1

We are trying to sync QuickBooks order header and details into two different tables but in one Zap. We would like to write the order’s header record to order_headers and then create the order line rows (1 or more) in a separate table (order_lines).

Is there a way to do both in the same Zap? Our existing Zap has a New Row action followed by a second. The first creates the header record in the intended table correctly but we haven’t yet figured out how to then write all of the associated lines to the second table. 

Whether we do it in a single Zap or two different Zaps, we would need to way for the second action (for the lines table) to use the order number from the first to only retrieve the associated line records for each order.

Any thoughts on the best way to do this?


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 1
Badge

Hi @Feign3

You can achieve this in a single Zap using custom code. First, write the order's header record to order_headers. Then, in the second action, use custom code (tryout quik.run) to retrieve associated line items using the order number. Process and insert the line items into the order_lines table within the same step or next step. If you'd like to learn more about QuikRun, feel free to connect with me at nparashar150@gmail.com or naman@quik.run̉, will be more than happy to resolve your issue.