Box New File to SharePoint Governance
When a file is added to a watched Box folder, the flow copies it to a structured SharePoint library, sets metadata, applies a retention label, and notifies the owner in Teams. Centralizes Box content 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 Box content into governed Microsoft 365 storage. When a file is added to a watched Box folder, the flow downloads it, copies it into a structured SharePoint document library (organized by yyyy/MM), stamps governance metadata on the new item, and notifies the owner channel in Microsoft Teams.
Why it matters: content split between Box and Microsoft 365 is hard to govern. Mirroring Box files into SharePoint with consistent metadata, a retention label, and a unique governance ID brings that content under Microsoft Purview / SharePoint policy and gives the team a single, auditable record of every captured file.
Ships Off (demo).
Use Case
A team receives working files in Box (from external partners, scanners, or line-of-business apps) that must ultimately be governed inside SharePoint Online. Instead of manual drag-and-drop, this flow watches the Box folder and automatically mirrors each new file into the governed library, tagging it so records managers can apply retention and disposition policy.
Flow Architecture
When a New File Is Uploaded to Box
Box - OnNewFilesV2Polls the watched Box folder every 5 minutes; splitOn yields one run per new file (id/name/path/size).
Initialize Config & Governance Id
Initialize variableSets the SharePoint site, archive library path and list GUID, retention label, Teams ids, a guid() governance id, and the yyyy/MM target folder path.
Get File Content From Box
Box - GetFileContentDownloads the file bytes by Box file id.
Create File In SharePoint
SharePoint - CreateFileWrites the Box bytes into the governed library under the yyyy/MM path; returns the new ItemId.
Update File Properties In SharePoint
SharePoint - Update file propertiesWrites governance metadata (Title, SourceSystem, BoxFileId, RetentionLabel, GovernanceId, CapturedDateTime) onto the new item.
Post Governance Notification to Teams
Microsoft Teams - PostMessageToConversationPosts a governance summary (file, source, SharePoint path, retention label, governance id, timestamp) to the owner channel.
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_BoxFolderId | String | REPLACE_WITH_BOX_FOLDER_ID | Box folder ID watched by the trigger (0 = Box root). |
| flowlibs_SharePointSiteURL | String | https://your-tenant.sharepoint.com | Target SharePoint site (shared with other FlowLibs flows). |
| flowlibs_ArchiveLibrary | String | /Box Archive | Server-relative path of the governed library (CreateFile folderPath). |
| flowlibs_ArchiveLibraryId | String | REPLACE_WITH_LIBRARY_GUID | Library list GUID (Update file properties table). |
| flowlibs_RetentionLabel | String | Standard-3yr | Retention label recorded on the governed item. |
| flowlibs_TeamsGroupId | String | <your-team-id> | Teams team (group) id for the notification. |
| flowlibs_TeamsChannelId | String | <your-channel-id> | Teams channel id for the notification. |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| Box | shared_box | OnNewFilesV2 GetFileContent |
| SharePoint | shared_sharepointonline | CreateFile ODataStylePatchFileItem |
| Microsoft Teams | shared_teams | PostMessageToConversation |
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.
- Create the SharePoint columns
- Add single-line-text columns SourceSystem, BoxFileId, RetentionLabel, GovernanceId and a date/time CapturedDateTime so Update file properties can write them (use one-word internal names to avoid _x0020_ encoding).
- Apply a real retention label
- The standard SharePoint connector has no apply-retention-label op, so this flow records the label as a column. To apply an actual Purview label, add an HTTP call to the SharePoint REST SetComplianceTag endpoint (or Graph) with an AAD-OAuth connection.
- Dedup
- Skip files whose hash or Box ID already exists in the library (add a lookup + Condition before CreateFile).
- Routing
- Choose the destination library or subfolder by Box folder or file type - branch on the file name extension or path.
- Two-way sync
- Add an OnUpdatedFiles trigger to keep Box and SharePoint aligned after edits.
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.01Structured target folder
Organizes captured files by month.
EXPR.02Per-file fan-out (trigger splitOn)
One run per new Box file.
EXPR.03New SharePoint item ID
Target for the metadata patch.
EXPR.04Governance/audit ID
Unique id stamped on the item and the Teams message.
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.