Google Drive to OneDrive Continuous Sync
On a short schedule, the flow mirrors a Google Drive folder tree into OneDrive for Business — copying new and changed files, preserving folder structure, and tracking a sync map to avoid duplicates. Keeps a Microsoft-side copy of Google Drive content current for users who work in OneDrive.
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 mirrors a Google Drive folder into OneDrive for Business on a 15-minute schedule. Each run lists the source folder, copies new and changed files into OneDrive, and records every sync in a Dataverse sync-map ledger so files are never duplicated and only changed files are re-copied. A run summary is posted to Microsoft Teams.
Why it matters: Users who work in OneDrive need current copies of Google Drive content without manual downloads. A tracked, idempotent sync keeps the Microsoft-side copy aligned with the Drive source.
Status: Built and verified - Flow Checker 0 errors / 0 warnings. Ships Off; going live needs only connection authorization + environment-variable values.
Use Case
A team collaborates in a Google Drive folder, but downstream Microsoft 365 users live in OneDrive. This flow continuously mirrors the Drive folder into OneDrive, copying new files on first sight and re-copying files whose modified time has changed, while a Dataverse ledger prevents duplicate copies and supports change detection.
Flow Architecture
Every 15 Minutes
RecurrenceSync cadence (every 15 minutes).
Initialize Correlation Id
Init Variable (String)guid() run id stamped on records + summary.
Initialize Synced Count
Init Variable (Integer)Counts files copied/updated.
Initialize Skipped Count
Init Variable (Integer)Counts unchanged files skipped.
Initialize Drive Root Id
Init Variable (String)Google Drive source folder id (env var).
Initialize OneDrive Root
Init Variable (String)OneDrive target path (env var).
Initialize Sync Map Table
Init Variable (String)Ledger entity-set name (env var).
Initialize Teams Group Id
Init Variable (String)Teams group id (env var).
Initialize Teams Channel Id
Init Variable (String)Teams channel id (env var).
List Drive Files
Google Drive - ListFolderLists items in the source folder (bare array).
Filter Files Only
Filter ArrayDrops subfolders (IsFolder eq false).
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_DriveRootId | String | REPLACE_WITH_GOOGLE_DRIVE_FOLDER_ID | Google Drive source root folder id. |
| flowlibs_OneDriveRoot | String | /DriveMirror | OneDrive target root folder path (set per deployment). |
| flowlibs_SyncMapTable | String | flowlibs_drivesyncs | Ledger entity-set name. |
| flowlibs_TeamsGroupId | String | <your-team-id> | Teams group id for the summary. |
| flowlibs_TeamsChannelId | String | <your-channel-id> | Teams channel id for the summary. |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| Google Drive | shared_googledrive | ListFolder GetFileContent |
| OneDrive for Business | shared_onedriveforbusiness | CreateFile |
| Microsoft Dataverse | shared_commondataserviceforapps | ListRecords CreateRecord UpdateRecord |
| Microsoft Teams |
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.
- Cadence
- Change the Recurrence interval (default 15 minutes) to match how fresh the OneDrive copy must be; cap files per run for very large folders to avoid throttling.
- Subfolders
- ListFolder is non-recursive. To mirror a tree, add a recursive pattern (list each subfolder id) or set flowlibs_OneDriveRoot per subfolder. OneDrive CreateFile auto-creates intermediate folders from the target path.
- Conflict policy
- Current rule is newer-wins by Drive modified time. For changed files, swap CreateFile for OneDrive UpdateFile (by file id) to overwrite in place rather than risk a duplicate name.
- Filters
- Extend Filter Files Only to include/exclude by file type or size.
- Two-way sync
- Add a reverse OneDrive -> Drive branch if both sides must stay aligned.
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.01Filter to files only
Drop subfolders from the listing.
EXPR.02Ledger lookup filter
Find the file id in the sync map.
EXPR.03Needs sync (new OR changed)
Copy new or modified files only.
EXPR.04Is new record
Branch create vs. update.
EXPR.05OneDrive target path
Destination path in OneDrive.
EXPR.06Record id for update
Ledger row id used by UpdateRecord.
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.