# Connect Microsoft Dynamics 365 to Microsoft OneDrive

> Stop moving files by hand. Sync your CRM data and business documents between Dynamics 365 and OneDrive automatically.

**Canonical page:** https://tray.ai/connectors/microsoft-dynamics-365-microsoft-onedrive-integrations/
**Microsoft Dynamics 365 connector:** https://tray.ai/connectors/microsoft-dynamics-365-integrations/
**Microsoft Dynamics 365 documentation:** https://tray.ai/documentation/connectors/service/microsoft-dynamics-365
**Microsoft OneDrive connector:** https://tray.ai/connectors/microsoft-onedrive-integrations/
**Microsoft OneDrive documentation:** https://tray.ai/documentation/connectors/service/microsoft-onedrive

## Overview

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.

Connecting Dynamics 365 with OneDrive puts an automated layer between your customer data and your document storage, so neither system falls behind the other. When a new opportunity lands in Dynamics 365, the integration can automatically build out a structured OneDrive folder, drop in the right proposal templates, and share it with the account team — all without anyone lifting a finger. When a signed contract gets uploaded to OneDrive, that same event can update the opportunity status in Dynamics 365, alert stakeholders, and kick off downstream workflows. Going both directions, this cuts administrative overhead, enforces consistent file naming and folder conventions, and keeps an auditable trail linking documents to CRM records. Sales, finance, and ops teams always work from current information instead of hunting for the latest version. At scale, that means faster deal cycles, cleaner data, and a stronger compliance posture.

## Use cases

### 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.

- Consistent folder structure across all CRM records without manual intervention
- File-sharing set up instantly so the right people have access from day one
- Folder names derived from CRM metadata cut down search time and misplaced files

### 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.

- Documents are accessible directly from the Dynamics 365 record
- Field updates in Dynamics 365 reflect the latest document status automatically
- No more duplicate file storage or version confusion across platforms

### 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.

- Automated PDF export and storage cuts finance team administrative work
- Documents organized by client and period make audits less painful
- Centralized OneDrive storage puts financial documents within reach across the organization

### 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.

- Scheduled report generation replaces manual data extraction and formatting
- A consistent OneDrive location means stakeholders always know where to look
- Automated notifications keep leadership and ops teams current

### 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.

- Onboarding stages in Dynamics 365 advance automatically as documents arrive
- Internal teams get notified the moment customer documents land
- Completeness checks run automatically — no one needs to manually audit the folder

### 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.

- Case attachments archived to OneDrive automatically, reducing CRM storage costs
- Long-term retention enforced without manual archiving work
- Account teams can review full case history from one OneDrive location

### 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.

- Campaign records in Dynamics 365 always reference the latest marketing materials
- Asset organization in OneDrive mirrors CRM campaign structure automatically
- Marketing and sales access consistent, current collateral without chasing each other down

## Templates

### 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.

Connectors used: Microsoft Dynamics 365, Microsoft OneDrive

### 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.

Connectors used: Microsoft Dynamics 365, Microsoft OneDrive

### 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.

Connectors used: Microsoft Dynamics 365, Microsoft OneDrive

### 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.

Connectors used: Microsoft Dynamics 365, Microsoft OneDrive

### 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.

Connectors used: Microsoft Dynamics 365, Microsoft OneDrive

### 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.

Connectors used: Microsoft Dynamics 365, Microsoft OneDrive

## Challenges Tray.ai solves

### 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 helps:** 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.

### 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 helps:** 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.

### 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 helps:** 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.

### 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 helps:** 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.

### 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 helps:** 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.

## Learn more

- Intelligent Integration: https://tray.ai/platform/intelligent-ipaas/
- Merlin Agent Builder: https://tray.ai/platform/merlin-agent-builder/
- Agent Gateway for MCP: https://tray.ai/platform/agent-gateway/
- Book a demo: https://tray.ai/contact/
