Skip to main content

My Shopify store is going to start selling products that come with promotional codes for some digital products. We have the promotional codes saved on Google Sheets (I know, I know, Google sheets is not a database… this is a temporary measure). Currently I have a way for if someone purchases qty:1 of SKU A, then my Zap will look up the first unassigned code on the sheet, enter the order number next to it, then send an email to the customer with the code. What I am struggling to figure out is how to have it so that if a customer order multiple copies of SKU A, they then get multiple unique codes. I’d like someone who orders qty: 3 of SKU A to get 3 unique codes from the sheet. Any ideas? 

 

 

In effect, you need to create a looping Zap.

Check this video:

 


This was helpful. I was able to figure it out. So to make the loop work, I created a separate log of order numbers and the amount that they ordered. Then each time the loop ran it add 1 to a column called “Qty of Codes Assigned” and then the filter for whether or not the loop ran again, was whether or not the difference between qty ordered and qty assigned was more than 0. Whew. Pretty task-heavy, but it works. Thanks!