Back to Piggy in Google Sheets
SheetXAI logo
Piggy logo
Piggy · Google Sheets Guide

Validate Voucher Codes Against Piggy Before an Email Send From a Google Sheet

2026-05-14
5 min read

The Scenario

Six months ago, 300 voucher codes went out to inactive customers as a re-engagement push. The CRM manager inherited the follow-up project from someone who left the team. The sheet is there — column A, 300 codes — but nobody knows which ones have already been used.

Sending spent codes to customers is not a neutral error. It creates support tickets, erodes trust in the loyalty program, and makes the reactivation campaign look incompetent. The codes need to be validated before anything goes out.

The bad version:

  • Open Piggy, go to the voucher lookup screen, paste code one, check the status, note it in column B.
  • Do that 300 times. At 45 seconds per code, that's nearly four hours of lookup work.
  • Realize halfway through that the status field in Piggy doesn't export cleanly and you're now building a manual key to decode what REDEEMED, EXPIRED, and AVAILABLE mean in this context.

The email send is next Tuesday. Four hours of lookup work is not in anyone's plan. And the codes were already distributed once — the pressure to not repeat the mistake is real.

The Easy Way: One Prompt in SheetXAI

SheetXAI is an AI agent that lives inside your Google Sheet. It reads the voucher codes from column A, checks each one against Piggy, and writes the redemption status back into the sheet in one pass.

For each voucher code in column A (300 rows), look it up in Piggy and write the redemption status and redeem date into columns B and C

What You Get

  • Column B fills with the current Piggy status for each code: REDEEMED, AVAILABLE, EXPIRED, or INVALID.
  • Column C shows the redemption date for any codes that have already been used — so you can see how stale the redemptions are.
  • Codes that Piggy doesn't recognize (malformed or never created) get INVALID in column B, surfacing any data issues in the original list.
  • The check runs across all 300 rows in one pass, giving you a filterable status column in under a minute.

What If the Data Is Not Quite Ready

The codes have inconsistent formatting — some prefixed, some lowercase

Normalize all voucher codes in column A to uppercase and trim whitespace, then for each code look it up in Piggy and write the status into column B and the redeem date (if any) into column C

You need to split the validated list into two separate tabs automatically

Check each voucher code in column A against Piggy. Write all AVAILABLE codes and their details into a new tab called 'Ready to Send'. Write all REDEEMED and EXPIRED codes into a tab called 'Do Not Send'. Write INVALID codes into column D on the current tab

Some codes were generated across multiple promotions — you need the promotion name too

For each code in column A, look it up in Piggy and write the status into column B, the promotion name into column C, and the redeem date into column D

Validate, filter, flag unusual cases, and summarize readiness in one pass

For each voucher code in column A, look it up in Piggy. Write the status into column B and the redeem date into column C. Highlight rows in red where the status is REDEEMED and in yellow where the status is EXPIRED. Leave AVAILABLE rows unhighlighted. Write a summary in cell E1: total codes, how many are AVAILABLE, how many are spent, and how many are INVALID

Combining the validation with the visual flagging and summary means you hand the email team a sheet they can act on immediately rather than a status column they still have to interpret.

Try It

Open a Google Sheet with your voucher code list and Get the 7-day free trial of SheetXAI. Ask it to validate every code against Piggy before your next send. For related workflows, see how to generate a voucher batch from a sheet or the full Piggy integration overview.

Stop memorizing formulas.
Tell your spreadsheet what to do.

Join 4,000+ professionals saving hours every week with SheetXAI.

Learn more