Microsoft Dynamics 365 + Microsoft OneDrive
Connect Microsoft Dynamics 365 with Microsoft OneDrive to Automate Document Management and CRM Workflows
Stop moving files by hand. Sync your CRM data and business documents between Dynamics 365 and OneDrive automatically.

Why integrate Microsoft Dynamics 365 and Microsoft OneDrive?
Dynamics 365 and OneDrive are both core Microsoft tools, yet keeping CRM records and business documents in sync between them usually means a lot of manual work. Sales teams, account managers, and operations staff routinely move contracts, proposals, invoices, and reports between Dynamics 365 and OneDrive folders — and that process breeds version conflicts, misplaced files, and compliance headaches. Integrating Dynamics 365 with OneDrive through tray.ai lets you automate document lifecycle management, make sure every CRM record has the right files attached, and give your teams their time back.
Automate & integrate Microsoft Dynamics 365 & Microsoft OneDrive
Use case
Automatic Folder Creation for New CRM Records
When a new account, opportunity, or lead is created in Dynamics 365, tray.ai automatically builds a structured OneDrive folder hierarchy mapped to that record. The folder is named using CRM metadata like account name, opportunity ID, or deal stage, then shared with the right team members. No one has to manually create and organize folders for every new business relationship.
Use case
Contract and Proposal Document Sync
Sales teams often write proposals and contracts outside of Dynamics 365 and store them in OneDrive. With this integration, when a document is uploaded or updated in a designated OneDrive folder, tray.ai automatically attaches it to the right Dynamics 365 opportunity or account record and updates relevant fields like document status or last-modified date. Both systems stay in sync without duplicate uploads.
Use case
Invoice and Financial Document Management
Finance teams can trigger automated workflows in tray.ai so that when an invoice or purchase order is generated in Dynamics 365 Finance, the document is automatically exported as a PDF and stored in a corresponding OneDrive folder organized by client or period. Finance documents are immediately available to authorized stakeholders — no manual export or upload required.
Use case
Sales Report Distribution and Storage
Managers and sales ops teams often need weekly or monthly performance reports pulled from Dynamics 365 and shared across the organization. tray.ai can automate the full process: extract Dynamics 365 report data on a schedule, compile it into a formatted document, save it to a shared OneDrive folder, and notify stakeholders via email or Teams — no human involvement needed.
Use case
Customer Onboarding Document Collection
During onboarding, businesses typically need signed agreements, identity documents, and configuration forms from new customers. tray.ai can watch a designated OneDrive folder for new uploads, then automatically update the Dynamics 365 customer record with document receipt status, trigger internal approval workflows, and advance the onboarding stage once all required documents are in.
Use case
Support Case Attachment Archiving
Support teams regularly attach screenshots, logs, and evidence files to Dynamics 365 service cases. With tray.ai, those attachments can be automatically archived to a structured OneDrive folder tied to the account, extending retention beyond Dynamics 365 storage limits and making case history easy to search for account management teams.
Use case
Marketing Asset Library Management
Marketing teams often keep campaign assets, product sheets, and branded collateral in OneDrive and need those files linked to the right Dynamics 365 campaigns or leads. tray.ai can detect new files added to OneDrive asset folders and associate them with the matching Dynamics 365 campaign records automatically, keeping marketing and CRM data aligned.
Get started with Microsoft Dynamics 365 & Microsoft OneDrive integration today
Microsoft Dynamics 365 & Microsoft OneDrive Challenges
What challenges are there when working with Microsoft Dynamics 365 & Microsoft OneDrive and how will using Tray.ai help?
Challenge
Mapping CRM Records to the Correct OneDrive Folder Structure
Dynamics 365 has multiple entity types — accounts, opportunities, leads, cases, and more — and mapping each one to the right OneDrive folder without creating duplicates or mismatches takes careful logic. Manual processes tend to produce inconsistent folder naming, orphaned folders, and broken links between CRM records and their documents.
How Tray.ai Can Help:
tray.ai's workflow logic lets teams define custom folder-mapping rules based on any combination of Dynamics 365 metadata fields. Conditional branching resolves the right folder path for every entity type, and built-in deduplication checks prevent redundant folder creation. tray.ai can also write folder URLs back to Dynamics 365 custom fields, creating a reliable two-way link between records and documents.
Challenge
Handling Large File Uploads and OneDrive API Rate Limits
Bulk document migrations, large PDF exports, or high-frequency attachment events can hit OneDrive API rate limits fast, causing failed uploads and data loss. Manual retries are error-prone and often need engineering involvement, which makes bulk document workflows unreliable without proper throttling.
How Tray.ai Can Help:
tray.ai has built-in rate limit handling and automatic retry logic that respects OneDrive API thresholds. For large file transfers, it supports chunked upload strategies to move files of any size reliably. Failed steps are retried automatically, and operations teams can monitor failure events through tray.ai's logging and alerting tools.
Challenge
Maintaining Data Consistency Between Both Platforms
Changes in Dynamics 365 — account renames, opportunity stage updates, record deletions — often need to be reflected in the corresponding OneDrive folder structure, and vice versa. Without automation, the two systems drift apart quickly, leaving stale folder references, misnamed directories, and CRM records pointing to files that no longer exist or have moved.
How Tray.ai Can Help:
tray.ai supports event-driven triggers on both sides of the integration. When a Dynamics 365 record is updated or renamed, a workflow can automatically rename or reorganize the corresponding OneDrive folder. File events in OneDrive can equally trigger field updates in Dynamics 365. Both systems stay aligned without manual reconciliation.
Challenge
Enforcing Access Permissions and Document Security
Sharing OneDrive folders with the right internal and external stakeholders — matched to Dynamics 365 record ownership and team assignments — is a real governance problem at scale. Manual permission management leads to over-shared sensitive documents, unauthorized access to client files, or team members locked out of folders they actually need.
How Tray.ai Can Help:
tray.ai workflows can automatically apply OneDrive sharing permissions based on Dynamics 365 record ownership, team membership, and role assignments when a folder is created or updated. When a record owner changes in Dynamics 365, tray.ai triggers a matching permission update in OneDrive. Access governance stays consistent without relying on periodic manual audits.
Challenge
Managing Document Versioning and Avoiding Duplicate Files
When both Dynamics 365 and OneDrive are used as document repositories without a clear integration layer, teams end up with duplicate files, conflicting versions, and no clear answer on which document is current. This gets particularly messy for contracts and regulated documents that need a single authoritative version.
How Tray.ai Can Help:
tray.ai workflows check for existing files in OneDrive before uploading a new version, using OneDrive's native versioning to maintain a clean history. Workflows can also update Dynamics 365 with the version number and last-modified timestamp, giving CRM users visibility into document history directly from the record. Duplicate detection logic prevents the same file from being uploaded multiple times across different workflow runs.
Start using our pre-built Microsoft Dynamics 365 & Microsoft OneDrive templates today
Start from scratch or use one of our pre-built Microsoft Dynamics 365 & Microsoft OneDrive templates to quickly solve your most common use cases.
Microsoft Dynamics 365 & Microsoft OneDrive Templates
Find pre-built Microsoft Dynamics 365 & Microsoft OneDrive solutions for common use cases
Template
Create OneDrive Folder When New Dynamics 365 Opportunity Is Created
This template listens for new opportunity records in Dynamics 365 and automatically creates a structured OneDrive folder hierarchy using the opportunity name, account name, and stage. It shares the folder with assigned team members and writes the folder URL back to the Dynamics 365 record for easy access.
Steps:
- Trigger fires when a new opportunity is created in Dynamics 365
- Extract opportunity metadata including name, account, owner, and close date
- Create a parent folder in OneDrive named after the account and a subfolder for the opportunity
- Share the folder with the opportunity owner and relevant team members
- Write the OneDrive folder URL back to a custom field on the Dynamics 365 opportunity record
Connectors Used: Microsoft Dynamics 365, Microsoft OneDrive
Template
Sync OneDrive Document Uploads to Dynamics 365 Record Attachments
This template monitors a designated OneDrive folder for new file uploads and automatically attaches those files to the corresponding Dynamics 365 account or opportunity record. It maps files to CRM records using a folder naming convention tied to Dynamics 365 record IDs or account names.
Steps:
- Trigger fires when a new file is uploaded to a monitored OneDrive folder
- Parse the folder name or file metadata to identify the associated Dynamics 365 record
- Retrieve the matching account or opportunity record from Dynamics 365
- Attach the file to the Dynamics 365 record and log the upload timestamp
- Send a notification to the record owner confirming the document has been linked
Connectors Used: Microsoft Dynamics 365, Microsoft OneDrive
Template
Export and Archive Dynamics 365 Invoices to OneDrive on Creation
When a new invoice is generated in Dynamics 365, this template automatically exports it as a PDF and saves it to a client-specific OneDrive folder organized by year and month. It then updates the invoice record in Dynamics 365 with the OneDrive file link for traceability.
Steps:
- Trigger fires when a new invoice record is created in Dynamics 365
- Retrieve invoice details and generate or fetch the PDF version of the document
- Determine the correct OneDrive folder path based on client name and invoice date
- Upload the PDF to the appropriate OneDrive folder, creating subfolders if needed
- Update the Dynamics 365 invoice record with the stored OneDrive file URL
Connectors Used: Microsoft Dynamics 365, Microsoft OneDrive
Template
Scheduled Dynamics 365 Sales Report Generation and OneDrive Storage
On a recurring schedule, this template queries Dynamics 365 for sales metrics, compiles the data into a formatted report, saves it to a shared OneDrive folder, and notifies leadership via email with a direct link to the new report.
Steps:
- Scheduled trigger fires on a weekly or monthly cadence
- Query Dynamics 365 for opportunity pipeline, closed deals, and revenue metrics
- Format the extracted data into a structured report document
- Upload the report to a designated leadership OneDrive folder with a date-stamped filename
- Send an email notification to stakeholders with the OneDrive link to the new report
Connectors Used: Microsoft Dynamics 365, Microsoft OneDrive
Template
Advance Dynamics 365 Onboarding Stage When Required OneDrive Documents Are Received
This template monitors a customer onboarding OneDrive folder and checks for required document completeness. When all expected files are present, it automatically updates the Dynamics 365 customer record to advance the onboarding stage and notifies the onboarding team.
Steps:
- Trigger fires when a new file is uploaded to a customer-specific OneDrive onboarding folder
- Retrieve the current file list in the folder and compare against a required document checklist
- If all required documents are present, locate the matching Dynamics 365 customer record
- Update the onboarding stage field in Dynamics 365 to the next phase
- Send an internal notification to the onboarding team confirming document completeness
Connectors Used: Microsoft Dynamics 365, Microsoft OneDrive
Template
Archive Dynamics 365 Case Attachments to OneDrive for Long-Term Retention
This template automatically detects new attachments added to Dynamics 365 service cases and archives them to a structured OneDrive folder organized by account and case number, making case history accessible to account management teams long after the case closes.
Steps:
- Trigger fires when a new attachment is added to a Dynamics 365 service case
- Retrieve case metadata including account name, case number, and creation date
- Determine or create the appropriate OneDrive folder path for the account and case
- Upload the attachment file to the OneDrive archive folder
- Log the OneDrive file URL on the Dynamics 365 case record for reference
Connectors Used: Microsoft Dynamics 365, Microsoft OneDrive