• Instructions to Ask a Question

    For any assistance, please click the "Ask a Question" button and select the Pabbly product for which you require support.

    We offer seven comprehensive applications designed to help you efficiently manage and grow your business:

    Our support team endeavors to respond within 24 business hours (Monday to Friday, 10:00 AM to 6:00 PM IST). We appreciate your understanding and patience.

    🚀 Exclusive Lifetime Offers 🚀

    We invite you to take advantage of our special one-time payment plans, providing lifetime access to select applications:

    • 🔥 Pabbly Connect — Lifetime Access for $249View Offer
    • 🔥 Pabbly Subscription Billing — Lifetime Access for $249View Offer
    • 🔥 Pabbly Chatflow — Lifetime Access for $249View Offer

    Make a one-time investment and enjoy the advantages of robust business management tools for years to come.

Retrieve vouchers from a list in Google Sheets

phil

Member
When a customer buy a product by Plug and Paid, we would like to send 2 discount vouchers for the next orders.
In a Google Sheet we have different sheet's tabs, where one contains 1000 voucher codes.

Which is the best workflow to retrieve and remove 2 of these vouchers from the Google Sheet, for every order?
 

Neeraj

Administrator
Staff member
Do checkout this video for some ideas around setting up that automation.

Instead of webhook from ThriveCart, your webhook will be from PlugNPaid.

 

phil

Member
That could be a solution. Thanks.
Just missing a detail.
For every product there's a different amount of vouchers:

Product A -> 2 vouchers
Product B -> 3 vouchers
Product C -> 4 vouchers

As far I can see the counter solution wouldn't work, if used in a conditional workflow.
There's a way to store the number of vouchers as a variable?

Thanks
 
P

PabblyMember3

Guest
That could be a solution. Thanks.
Just missing a detail.
For every product there's a different amount of vouchers:

Product A -> 2 vouchers
Product B -> 3 vouchers
Product C -> 4 vouchers

As far I can see the counter solution wouldn't work, if used in a conditional workflow.
There's a way to store the number of vouchers as a variable?

Thanks
Can you please elaborate your use case with some real example?
 

phil

Member
Well, simple.
If customer buy "Product A" become, as gift, 2 voucher codes for the next order.
If customer buy "Product B" become, as gift, 3 voucher codes the next order.
If customer buy "Product C" become, as gift, 4 voucher codes the next order.

We have 1000 voucher codes already registered in the Plug and Paid cart, and we copied those codes in Google Sheets.
The codes should be automatically sent to the buyer's email.

Of course would be better if PC would read the codes directly from PlugnPaid, but I think there's no API for this.
 
P

PabblyMember3

Guest
What best I can suggest is to pick the voucher codes from your google sheet randomly on each sale, you can use Get Row(s) action of the Google Sheet app inside your workflow, also, you need to route your workflow for 3 products

Route1 - Product A

Here, you can get the random number between 1 and 1000 using Number Formatter - Spreadsheet Formula as shown here:

random.png


as you have 1000 vouchers in your sheet then, you can do a math operation Number Formatter - Perform Math Operation on that number and add 1 to it as shown below:

math.png


Now, use the above numbers in the Google Sheets- Get Row(s) action eg. A71:A72, this will bring you data of two consecutive rows of your sheet containing the voucher code and you can send them to the user.

getrow.png


Similarly, you can do the above steps for your other products (Route 2 and Route 3) but with different math operation.

I hope the above solution helps.
 
Top