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 for | Operations or data quality teams maintaining customer records in separate shared Sheets across departments. |
|---|---|
| APIs | Sheets API, Drive API |
| Typical scopes | drive, 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
- A delegated service account enumerates target Sheets from a known Drive folder or list.
- For each Sheet, it reads relevant ranges and normalises key fields (e.g., email, name, phone) for comparison.
- It performs a cross-Sheet duplicate detection pass, flagging potential matches based on configurable similarity criteria.
- 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.
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 guideRelated use cases
Create a client folder structure the moment a deal closes
Provision a consistent Drive folder tree, seeded with templates and shared with the right people, automatically.
Generate documents from a template and real data
Produce agreements, letters and reports from a Docs template with fields filled from your systems.
Sort incoming files into the right place automatically
Watch a drop folder, work out what each file is, and file it where it belongs with a consistent name.