domainwidedelegation.comStart free

Use cases → Documents and Drive

Detect duplicate customer records across shared sheets

Use a delegated service account to scan multiple shared Sheets for duplicate customer entries, surfacing conflicts for human review before they propagate into downstream systems.

Who it is forOperations or data quality teams maintaining customer records in separate shared Sheets across departments.
APIsSheets API, Drive API
Typical scopesdrive, spreadsheets.readonly

The problem

Customer data is often entered into separate shared Sheets by different teams, leading to subtle duplication — misspelled names, swapped fields or slightly different contact details. These duplicates silently break downstream reporting, billing and support processes, but are rarely noticed until they cause a conflict.

How it works

  1. A delegated service account enumerates target Sheets from a known Drive folder or list.
  2. For each Sheet, it reads relevant ranges and normalises key fields (e.g., email, name, phone) for comparison.
  3. It performs a cross-Sheet duplicate detection pass, flagging potential matches based on configurable similarity criteria.
  4. A summary report is written to a separate Sheet or sent to designated reviewers for manual resolution.

What changes

Duplicate records are surfaced before they trigger failures in dependent systems. Teams see possible conflicts in one place, rather than after the fact.

The trap in this one. The Sheets API will return cell values as they are stored, not as they are displayed. Formatted values (e.g., numbers, dates) may differ from what the user sees, so naive matching will miss or misidentify duplicates. This is especially acute when data is entered in inconsistent formats (e.g., '01/02/2024' vs '1 Feb 2024'), and the silent mismatch will only be noticed after a customer is missed or double-billed.

Watch it explained

“Find Duplicates - Google Apps Script” — Karl Kranich on YouTube. Third-party video, included because it covers this ground well. We are not affiliated with the channel.

Questions people ask

Does this require changing permissions on every Sheet?

No, domain-wide delegation allows the service account to access any Sheet the target users can access, as long as they are within the same Workspace tenant.

Can this handle thousands of rows across many Sheets?

Yes, but the Sheets API has read limits and performance will degrade with very large Sheets. Batch reads and careful filtering are required.

Want this built?

This is a pattern we run in production. We will set up the delegation and build this on top of it — $500 per hour, most of it working the same day.

Talk to us Or read the setup guide

Related use cases

Track company policy acknowledgments at scale in Workspace

Automate sending, collecting, and recording policy acknowledgments using delegated access and Drive-linked Sheets.

Enforce storage quotas on shared drives with automation

Automate monitoring and enforcement of shared drive quotas to avoid overages and operational surprises.

Automate recurring task assignment for Workspace teams

Use a delegated service account to assign and rotate tasks among team members on a scheduled basis, without relying on manual intervention.