Google Contacts Data Quality Cleanup
On a schedule, the flow scans Google Contacts for missing fields, malformed emails/phones, and likely duplicates, normalizes what it safely can, flags the rest in a Dataverse review queue, and emails the owner a quality report. Keeps the Google Contacts address book clean and deduplicated.
Provided as-is, without warranty of any kind. Review and test each pattern in a non-production environment before deploying it to live automations. See our Terms.
Overview
This flow keeps Google Contacts clean. On a weekly schedule it reads every contact, checks each one for data-quality problems (missing name, missing/malformed email, missing phone, and duplicate emails), writes a review-queue record to Dataverse for each contact with an issue, and emails the owner an HTML quality report via Outlook.
Why it matters: Dirty contact data causes bounced emails and bad CRM records. A recurring, governed quality sweep keeps the address book reliable and gives the owner an auditable review queue.
Status: Built as an Off demo. Going live requires only (1) authorizing the three connections and (2) setting the flowlibs_QualityReportRecipient environment variable. Flow Checker: 0 errors / 0 warnings (in-designer).
Use Case
Operations / IT Admin teams that maintain a shared Google Contacts address book and want it continuously validated and deduplicated, with a tracked review queue for issues that need a human decision (e.g. likely duplicates or missing emails).
Flow Architecture
Run Weekly Quality Scan
Recurrence (Weekly, Mon 07:00 ET)Schedules the quality sweep.
Initialize varCorrelationId
Initialize Variable (String) = guid()Run ID stamped on every record for end-to-end trace.
Initialize varReviewStatus
Initialize Variable (String) = Pending ReviewConfigurable status label for queue records.
Initialize varReportRecipient
Initialize Variable (String)Report recipient from the environment variable.
Initialize varSeenEmails
Initialize Variable (Array)Running seen-email list for duplicate detection.
Initialize varTotalContacts
Initialize Variable (Integer)Counter of contacts scanned.
Initialize varIssueCount
Initialize Variable (Integer)Counter of contacts with issues.
Initialize varIssueRows
Initialize Variable (String)Accumulates HTML rows for the report.
Get Google Contacts
Google Contacts — PeopleApiListContactsV4Retrieves all contacts (People API v4).
Apply to each Contact
Foreach (sequential, concurrency 1)Validates one contact at a time.
Compose Contact Fields
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_QualityReportRecipient | String | data-quality@flowlibs.local | Email address that receives the quality report |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| Google Contacts | shared_googlecontacts | PeopleApiListContactsV4 |
| Microsoft Dataverse | shared_commondataserviceforapps | CreateRecord |
| Office 365 Outlook | shared_office365 | SendEmailV2 |
Note — All connections are referenced as solution connection references; the flow is portable between environments as long as a connection is mapped at import time.
Customization Guide
Almost every realistic variant of this flow can be implemented by changing environment variable values. A few cases require small edits inside the flow definition — those are called out explicitly below.
- Schedule
- Edit the Run Weekly Quality Scan recurrence (frequency / day / hour / time zone).
- Validation rules
- Adjust the checks in Compose Issue Raw (e.g. require a phone, add a region-specific phone-format regex, or treat malformed emails differently).
- Auto-fix
- If a writeback path is added later (Google People API via an HTTP action with OAuth), the suggested normalization in each record can be applied automatically for safe cases.
- Merge assist
- Extend duplicate handling to propose merges rather than just flagging.
- Report routing
- Point flowlibs_QualityReportRecipient at a shared mailbox, or add a Teams post alongside the email.
Key Expressions
The flow is intentionally light on Power Fx / WDL gymnastics — the heaviest expressions are the branch-name concatenation and the approval outcome check. They are listed below in the order they appear in the flow.
EXPR.01Primary email (normalized)
Trims and lower-cases the first email for comparison.
EXPR.02Malformed email
Flags emails missing an @ or a dot.
EXPR.03Duplicate email
True when the email was already seen this run.
EXPR.04Issue list (strip trailing separator)
Removes the trailing semicolon separator.
EXPR.05Has issue
True when at least one issue was detected.
Customize & download
Generate a ready-to-import copy of this solution with your environment-variable values baked in — available on Base, Pro, or Team.
Upgrade to customize
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.