The Scenario
A data quality analyst ran a deduplication audit on the Piggy loyalty database last month. She found 60 duplicate customer pairs — same person, two accounts, split loyalty history. The pairs are documented in an Excel workbook: the 'ContactMerges' sheet, source_uuid in column A, destination_uuid in column B. All 60 need to be merged.
The bad version:
- Open Piggy, find the contact merge tool, search for the first source UUID, find the destination, initiate the merge, confirm.
- Do that 60 times. Even at 2 minutes per merge, that's two hours of clicking.
- Around merge 40, you accidentally select the wrong destination UUID and merge two unrelated customers. Now you have a support ticket, a credit balance discrepancy, and a rollback request.
The duplicates were identified with care. The merge itself should not require human attention at every step.
The Easy Way: One Prompt in SheetXAI
SheetXAI is an AI agent that lives inside your Excel workbook. It reads the source and destination UUID pairs, submits each merge to Piggy, and writes the result status back into column C — so you have a full audit log when it's done.
Read the Excel table 'ContactMerges' (60 rows, columns: source_uuid, destination_uuid), submit each merge to Piggy, and log QUEUED or ERROR into column C
What You Get
- Column C fills with the merge status for each pair — QUEUED, COMPLETED, or ERROR depending on what Piggy returns.
- Rows where the merge failed (invalid UUID, contact already merged, API error) get a descriptive error in column C so you can investigate those specific pairs.
- You have a permanent record of every merge submitted — useful for the audit trail if a customer later asks about their balance.
- All 60 merges are submitted in one pass without manual intervention.
What If the Data Is Not Quite Ready
Some pairs might have already been merged — check before submitting
For each row in the 'ContactMerges' sheet, check whether the source UUID still exists as an active Piggy contact. If it does, submit the merge and write MERGED into column C. If the source is already gone, write ALREADY MERGED into column C and skip
The merge direction needs to be verified — you want the higher-balance account to be the destination
For each row in the 'ContactMerges' sheet, fetch the credit balance for both the source UUID (column A) and destination UUID (column B) from Piggy. If the source balance is higher, swap the merge direction. Submit the merge with the higher-balance account as the destination and write the actual source and destination used into columns D and E. Log the result into column C
Some destination UUIDs contain typos — normalize before submitting
For each row in the 'ContactMerges' sheet, trim whitespace from columns A and B and validate that both values are in UUID format. Flag any malformed pairs in column C with INVALID FORMAT. For all valid pairs, submit the merge to Piggy and write the result into column C
Validate both UUIDs, check balances, submit merges in the right direction, and summarize
For each of the 60 pairs in the 'ContactMerges' sheet, validate that both UUIDs exist in Piggy. Fetch balances for each. Merge the lower-balance account into the higher-balance account. Write the merge direction used into column D, the result into column C, and the combined balance into column E. Write a summary in cell G1: total submitted, total completed, total errors
Running the balance check and direction logic inline means you never accidentally consolidate credits into the wrong account.
Try It
Open an Excel workbook with your duplicate UUID pairs and Get the 7-day free trial of SheetXAI. Ask it to submit all your Piggy contact merges and write a status log back into the workbook. For related workflows, see how to bulk create custom contact attributes or the full Piggy integration overview.
