Best answer

Issue multiple promo codes using Shopify and Google Sheets

  • 8 December 2020
  • 2 replies

Userlevel 1

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? 




Best answer by Troy Tessalone 8 December 2020, 20:14

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.

2 replies

Userlevel 7
Badge +14

In effect, you need to create a looping Zap.

Check this video:


Userlevel 1

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!