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

Pull Credit Balances Into a Google Sheet to Find Your Top Loyalty Members

2026-05-14
5 min read

The Scenario

Someone on the marketing team sends a message at 10 AM: "Can we have the top 50 loyalty members by balance by noon? We're finalizing the VIP event invite list." You have 1,000 customer UUIDs in your Google Sheet. Column A has the UUIDs, column B is empty.

The bad version:

  • Pull up the Piggy dashboard, find the customer search, paste UUID one, note the balance, go back to the sheet, type it into row 1.
  • Multiply by 1,000. Even at 30 seconds per customer, that's eight hours — not a noon deadline.
  • Export options from Piggy don't include credit balances in the format your sheet uses, so you'd have to pivot or VLOOKUP across two files, and now you're debugging a formula instead of finding your VIPs.

The VIP event is a real deadline. Pulling 1,000 balances manually is not a real option. And you already have the sheet.

The Easy Way: One Prompt in SheetXAI

SheetXAI is an AI agent that lives inside your Google Sheet. It reads the UUID list, fetches each credit balance from Piggy, writes it back inline, and can sort the result — all in one go.

For each contact UUID in column A (1,000 rows), fetch the Piggy credit balance and write it into column B, then sort the sheet by column B descending

What You Get

  • Column B fills with the current Piggy credit balance for each UUID, pulled live from the API.
  • The sheet sorts descending by column B so your top 50 loyalty members are immediately at the top.
  • Contacts where Piggy returned no balance (new accounts, deleted contacts) get a 0 or a note so you can review them without breaking the sort.
  • The whole operation completes in one pass — no intermediate CSV, no VLOOKUP, no pivot table.

What If the Data Is Not Quite Ready

Some UUIDs are inactive or the contact no longer exists in Piggy

For each UUID in column A, fetch the Piggy credit balance and write it into column B. If the contact is not found, write NOT FOUND into column B. Sort by column B descending, placing NOT FOUND rows at the bottom

You need the balance plus the customer's name and email for the invite list

For each UUID in column A, fetch the Piggy contact details and credit balance. Write the contact name into column B, email into column C, and credit balance into column D. Sort by column D descending

Your UUIDs are spread across two tabs and need to be consolidated first

Combine the UUID lists from tab 'East Region' column A and tab 'West Region' column A into a new tab called 'All Customers', remove duplicates, then fetch each Piggy credit balance and write it into column B. Sort descending by column B

Identify the top 50, add a VIP flag, pull balances, and prep the invite list in one pass

For each UUID in column A, fetch the Piggy credit balance and write it into column B. Sort descending by column B. Mark the top 50 rows with VIP in column C and the rest with STANDARD. Write the associated Piggy contact email into column D for the VIP rows only

Combining the data pull with the segmentation logic means you hand someone a ready-to-send invite list instead of a raw balance dump.

Try It

Open any Google Sheet with a customer UUID list and Get the 7-day free trial of SheetXAI. Ask it to fetch Piggy balances and rank your members. For related work, see how to bulk award credits 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