Google Drive New File to SharePoint Archive
When a file is added to a watched Google Drive folder, the flow copies it to a structured SharePoint library, sets metadata from the file name/path, marks the original migrated, and notifies the owner in Teams. Centralizes Google Drive uploads into governed Microsoft 365 storage.
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 centralizes Google Drive uploads into governed Microsoft 365 storage. On a schedule it polls a watched Google Drive folder, copies each new file into a structured SharePoint library (organized by date), sets the file's Title metadata, records the migration in a Dataverse ledger, and notifies the owner in a Teams channel.
Why it matters: Files scattered in Google Drive are hard to govern. Mirroring them to SharePoint - with a durable migration ledger - makes them searchable, retained, backed up, and idempotently de-duplicated across polls.
Status: Built and verified (Flow Checker 0 errors / 0 warnings). Ships Off; going live requires only connection authorization and env-var configuration.
Use Case
A team receives files in Google Drive that must live in SharePoint for governance, retention, and discoverability. IT/Operations want an unattended, repeatable bridge that never double-archives the same file and leaves an audit trail of what was migrated and when.
Flow Architecture
Recurrence Poll Drive Folder
RecurrencePoll the watched folder on a schedule (Minute/15).
Init varCorrelationId ... Init varTeamsChannelId
Initialize VariablecorrelationId = guid(); bind SP site URL, library GUID, library path, source system, Teams group/channel from env vars.
Compose Target Folder
ComposeBuild dated subfolder: library path + yyyy/MM.
List Drive Files
Google Drive - ListFolderList the watched folder contents.
Apply to each File
Foreach (sequential)Iterate each item; concurrency 1 for dedup safety.
Condition Is File
ConditionSkip subfolders (IsFolder = false).
Check Existing Log
Microsoft Dataverse - ListRecordsDedup: look up the Drive file id in the ledger.
Condition Is New
ConditionOnly archive files not already migrated (length(value) = 0).
Get File Content
Google Drive - GetFileContentDownload the file bytes by id.
Create SharePoint File
SharePoint - CreateFileWrite into the structured archive library (auto-creates date folders).
Set File Metadata
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_DriveFolderId | String | REPLACE_WITH_GOOGLE_DRIVE_FOLDER_ID | Watched Google Drive folder id. |
| flowlibs_SharePointSiteURL | String | https://your-tenant.sharepoint.com | Target SharePoint site (reused). |
| flowlibs_ArchiveLibraryPath | String | /Shared Documents/Drive Archive | Server-relative archive library/folder root. |
| flowlibs_ArchiveLibraryGuid | String | REPLACE_WITH_SP_LIBRARY_GUID | Library list GUID (for the metadata patch). |
| flowlibs_ArchivePathDateFormat | String | yyyy/MM | Date format for the dated subfolder. |
| flowlibs_DriveSourceSystem | String | Google Drive | Source-system label stamped on the ledger. |
| flowlibs_TeamsGroupId | String | <your-team-id> | Teams team/group id for the notice (reused). |
| flowlibs_TeamsChannelId | String | <your-channel-id> | Teams channel id for the notice (reused). |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| Google Drive | shared_googledrive | ListFolder GetFileContent |
| SharePoint | shared_sharepointonline | CreateFile ODataStylePatchFileItem |
| Microsoft Dataverse | shared_commondataserviceforapps | ListRecords CreateRecord |
| 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.
- Poll interval
- Change the Recurrence frequency/interval (e.g. every 5 minutes for faster archiving).
- Folder structure
- Edit flowlibs_ArchivePathDateFormat (e.g. yyyy/MM/dd) or extend Compose Target Folder to include the source folder name.
- Richer metadata
- ODataStylePatchFileItem uses a plain (non-dynamic-schema) item object, so you can add custom library columns (e.g. DriveFileId, SourceSystem) without Flow Checker errors once those columns exist in the target library.
- Export format
- For Google-native files, branch on MediaType and choose an export MIME before download.
- Dedupe by hash
- Store an ETag/hash column and compare to detect content changes, not just new ids.
- Notification target
- Swap the Teams post for Outlook SendEmailV2 to email the owner, or include an adaptive card.
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.01Dated target folder
Build the dated archive subfolder.
EXPR.02Skip folders
Act only on real files.
EXPR.03Dedup filter
Look up the Drive file id in the ledger.
EXPR.04New-file test
Only archive files not already migrated.
EXPR.05SharePoint item id for metadata
Item id used by the metadata patch.
EXPR.06Correlation id
Per-file trace id (also on the Teams notice).
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.