Best answer

How to export an ordered list of line items from a Zapier loop?

  • 9 February 2023
  • 4 replies

Userlevel 1
​​​​​Loop specifics on the left, and Zap overview on the right

I have a Zap that takes order info from Woocommerce and compiles it into a Quotient lead. This works fine for single product orders, but for multiple products I need a loop. Currently, this just exports everything in line (i.e. Product 1 name, Product 2 name, Product 1 attributes, Product 2 attributes, etc). Ideally it would be collated (i.e. Product 1 name, Product 1 attributes, Product 2 name, Product 2 attributes, etc) depending on the number of items in the order.

Furthermore, I assume this would create a new lead in Quotient for every loop, as the final step is included inside the loop (i.e. it would create 3 separate leads for an order with 3 products, for 3 iterations of the loop). Is there any way to remedy this? Would this involve some Code by Zapier, or a Filter? or 2 separate Zaps?


Best answer by Danvers 14 February 2023, 12:24

View original

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 +11

Hi @Wallenium!

Any chance you could share some more details (screenshots) of the rest of the steps in Looping by Zapier? It will help us get a clearer picture of how all the pieces fit and what you’re trying to accomplish :)


Userlevel 1

Sure thing, here are the details of my loop:

As you can see, the loop works perfectly, I’m just curious how one would combine this data into a message. Is there some mechanism to collate loop data? This is how it looks in the Quotient entry:


Userlevel 7
Badge +12

Hi @Wallenium

Thanks for sharing that extra detail, super helpful!

So if I understand the Zap correctly, the loop takes each line item and reformats it, and you would like to take that information and add it to Quotient as one field, is that right?

If so, you can use that by using Digest by Zapier and adding a couple of extra steps in your Zap. Digest allows you to add information into a particular store and release it at a point you choose. In this case you would be adding each line item to the Digest and then releasing it and adding it to Quotient on the last line item. 

To make sure that the Digest release and Quotient steps only happen once (ie not on every loop) you need to add a Filter step into the loop. Set the filter to only continue if the value loop_iteration_is_last matches the (Boolean) Is True condition. 

The outline of your loop will look like this:

  • Create Loop
    • Formatter Steps
    • Append Entry and Schedule Digest (set the Digest ‘Schedule’ to a manual release)
    • Filter - only continue if the value loop_iteration_is_last matches the (Boolean) Is True condition. 
      • Digest - release existing Digest
      • Quotient action

Does that look like it will do what you need? ​Let us know if you have any questions!

Userlevel 1

Thanks @Danvers! This works perfectly. Here’s what the outline looks like for anyone curious: