Skip to main content
Best answer

Issue multiple promo codes using Shopify and Google Sheets

  • December 8, 2020
  • 2 replies
  • 60 views

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

In effect, you need to create a looping Zap.

Check this video:

 

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

Troy Tessalone
Zapier Orchestrator & Solution Partner
Forum|alt.badge.img+14
  • Zapier Orchestrator & Solution Partner
  • Answer
  • December 8, 2020

In effect, you need to create a looping Zap.

Check this video:

 


  • Author
  • Beginner
  • December 8, 2020

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!