Google Contacts Distribution List Builder
On a schedule (or on demand), the flow reads a Google Contacts group, builds or refreshes an Office 365 distribution list / Teams membership / Outlook contact group from it, and reports additions and removals. Keeps Microsoft distribution lists in lockstep with a Google contact group.
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
FlowLibs - Google Contacts Distribution List Builder keeps a Microsoft 365 distribution list (Office 365 group) in lockstep with the Google Contacts address book. On a daily schedule it reads every Google contact, scopes the set with an email-domain filter, compares it to the current Office 365 group membership, then adds the new members and removes the stale ones — and emails an additions/removals report.
Why it matters: Maintaining the same audience in two systems is error-prone. Driving the Microsoft list from Google Contacts keeps them aligned automatically, with a daily audit trail of what changed.
Status: Built — ships Off (demo). Going live requires only connection authorization and environment-variable configuration.
Use Case
A team curates an audience in Google Contacts and needs the matching Office 365 group / distribution list kept current without manual edits. Each morning the flow reconciles the group and reports the deltas to an owner.
Flow Architecture
Daily Membership Refresh
Recurrence (Day/1, 05:00)Refresh cadence.
Init varTargetGroupId
Initialize Variable (String)Target O365 group id, from env var.
Init varReportRecipient
Initialize Variable (String)Report recipient, from env var.
Init varGoogleGroup
Initialize Variable (String)Documented source Google group.
Init varDomainFilter
Initialize Variable (String)Email-domain scope, from env var.
Get Google Contacts
Google Contacts — PeopleApiListContactsV4Read the full address book.
Filter Contacts With Matching Email
Filter array (Query)Keep contacts that have an email AND match the domain filter.
Select Desired Emails
SelectProject to a lower-cased desired-email array.
Get Current Group Members
Office 365 Groups — ListGroupMembersRead current O365 group members.
Select Current Emails
SelectProject members to a lower-cased current-email array.
Filter Members To Add
Filter array (Query)Desired emails not already in the group.
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_TargetO365GroupId | String | <configure> | Target distribution list (Office 365 group) object id to keep in sync. |
| flowlibs_ReportRecipientEmail | String | alerts@yourcompany.com | Recipient of the additions/removals change report. |
| flowlibs_GoogleGroupResourceName | String | contactGroups/myContacts | Documented Google source group (portability; shown in the report). |
| flowlibs_ContactEmailDomainFilter | String | * | Only sync contacts whose primary email ends with this; * = all contacts with an email. |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| Google Contacts | shared_googlecontacts | PeopleApiListContactsV4 |
| Office 365 Groups | shared_office365groups | ListGroupMembers AddMemberToGroup RemoveMemberFromGroup |
| 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.
- Scope the audience
- Set flowlibs_ContactEmailDomainFilter to a domain like @contoso.com to sync only that domain's contacts, or * to include every contact with an email.
- Dry-run / report-only
- Disable the two Foreach loops (Apply To Add, Apply To Remove) to preview adds/removes without changing membership.
- Teams membership
- Point the group id at a Microsoft 365 group backing a Team to keep a Team's roster in sync.
- True Google group scoping
- Replace Get Google Contacts with a built-in HTTP call to the Google People API requesting personFields=memberships, then filter on flowlibs_GoogleGroupResourceName.
- Cadence
- Change the Recurrence trigger frequency/time.
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.01In-scope contact filter
Keeps contacts with an email matching the domain filter.
EXPR.02To add
Desired emails not already in the group.
EXPR.03To remove
Current members no longer in the Google set.
EXPR.04Remove by UPN
Resolves the member identifier for removal.
EXPR.05Report counts
Counts of additions and removals for the report.
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.