Microsoft OneDrive

Connect your Microsoft OneDrive to automatically sync documents, spreadsheets, presentations, and other files into your Twig AI knowledge base.

Overview

Property
Details

Type

Dynamic

Refresh

Scheduled (Daily, Weekly, Monthly)

Tier

2 (Professional & Enterprise)

Authentication

OAuth 2.0 (Microsoft)

Supported Files

Office documents, PDFs, and more

When to Use OneDrive Connector

The OneDrive connector is ideal for:

  • Microsoft 365 Environments - Organizations using Microsoft ecosystem

  • Personal Cloud Storage - Individual OneDrive accounts

  • Office Documents - Word, Excel, PowerPoint files

  • Cross-Platform Teams - Mixed environment teams

  • Cloud-Native Workflows - OneDrive-first organizations

Supported File Types

Microsoft Office Files

  • Word (.doc, .docx) - Microsoft Word documents

  • Excel (.xls, .xlsx, .xlsm) - Microsoft Excel spreadsheets

  • PowerPoint (.ppt, .pptx) - Microsoft PowerPoint presentations

  • OneNote (.one) - OneNote notebooks (limited support)

Other Formats

  • PDF (.pdf) - Portable Document Format

  • Text (.txt) - Plain text files

  • Rich Text (.rtf) - Rich Text Format

  • Images (.jpg, .png, .gif) - Image files with text extraction

  • OpenDocument (.odt, .ods, .odp) - Open Document formats

Prerequisites

Before setting up:

  • Microsoft account (personal or work/school)

  • OneDrive access with files to sync

  • Admin approval (for work/school accounts in some organizations)

How to Set Up OneDrive Connector

Step 1: Navigate to Data Sources

  1. Log in to your Twig AI account

  2. Click Data in the main navigation menu

  3. Click Add Data Source or the + button

  4. Choose MS-OneDrive from the list of connectors

  5. Note: Available on Professional and Enterprise plans

Step 2: Configure Basic Information

  • Name (required): Descriptive name

    • Example: "Personal OneDrive", "Team Documents", "Product Files"

  • Description (optional): Additional context

    • Example: "Marketing team's shared OneDrive folder"

  • Tags (optional): Organization tags

    • Examples: "onedrive", "microsoft", "documents"

Step 3: Authenticate with Microsoft

  1. Click Connect OneDrive or Authorize

  2. You'll be redirected to Microsoft's login page

  3. Sign in with your Microsoft account:

  4. Review requested permissions:

    • Read files - Access to your OneDrive files

    • Read file metadata - File names, dates, sizes

  5. Click Accept to grant permissions

  6. You may need admin approval for organizational accounts

  7. You'll be redirected back to Twig AI

Step 4: Select Folder or Files

After authentication, configure what to sync:

Option 1: Entire OneDrive

Option 2: Specific Folder

Option 3: Multiple Folders Create separate data sources for each folder.

Step 5: Configure Sync Options (JSON Parameters)

Available Parameters:

Parameter
Type
Description
Default

path

String

Folder path to sync

"/" (root)

recursive

Boolean

Include subfolders

true

fileTypes

Array

File extensions to include

All

includeShared

Boolean

Include files shared with you

true

maxFiles

Number

Maximum files to sync

1000

modifiedAfter

String

Only files modified after date (YYYY-MM-DD)

All

maxDepth

Number

Maximum folder depth

Unlimited

Step 6: Test Connection

  1. Click Test Config or Test Connection

  2. Twig will verify:

    • Authentication is valid

    • Folder path is accessible

    • Permissions are sufficient

  3. Wait for "Connection Successful" message

Step 7: Set Refresh Schedule

Choose sync frequency:

  • Never - Manual sync only

  • Daily - Sync changes daily (recommended)

  • Weekly - Sync weekly

  • Monthly - Sync monthly

Step 8: Save and Sync

  1. Click Save or Create

  2. Initial sync begins

  3. Monitor progress in data sources list

  4. Check process logs for errors

Finding OneDrive Folder Paths

OneDrive uses path-based addressing:

Common Paths

Finding Specific Paths

  1. Open OneDrive in your browser

  2. Navigate to the desired folder

  3. Look at the URL:

  4. Or use the folder name directly in path format:

Configuration Examples

Example 1: Personal Documents

Example 2: Work Documents

Example 3: Specific Project Folder

Best Practices

1. Use Work/School Accounts for Teams

For organizational use:

  • Use work/school Microsoft 365 accounts

  • Leverage shared folders and team libraries

  • Set up dedicated service accounts for integrations

  • Ensure proper permissions across teams

2. Organize with Clear Folder Structure

Structure OneDrive for easy syncing:

3. Filter by File Type

Focus on document types that work well with AI:

Avoid:

  • Executables (.exe, .msi)

  • Archives (.zip, .rar) - extract first

  • Binary formats without text content

4. Set Appropriate Scope

Good (Focused):

Avoid (Too Broad):

5. Handle Large File Collections

For many files:

  • Set maxFiles limit

  • Use modifiedAfter for recent files

  • Split into multiple data sources by folder

  • Set appropriate maxDepth

6. Monitor Shared Files

If using includeShared: true:

  • Be aware of files shared from outside your organization

  • Review permissions and access levels

  • Consider security implications

  • May want separate data source for shared files

Understanding Sync Behavior

Initial Sync

  • Downloads all files in specified path

  • Processes files in batches

  • May take time for large collections

Incremental Syncs

  • Detects modified files since last sync

  • Syncs only new or changed files

  • Much faster than initial sync

What Gets Synced

Synced:

  • New files added to folder

  • Modified file content

  • Files moved into synced path

  • Renamed files (as new files)

Not Synced:

  • Files moved out (remain until cleanup)

  • Deleted files (remain until cleanup)

  • Files without read permission

  • Files in recycle bin

  • Zero-byte files

File Conversion

Office files are processed directly:

  • Word → Text extraction from .docx

  • Excel → Data from cells and sheets

  • PowerPoint → Text from slides

  • PDF → Text extraction

Permissions & Security

OAuth Permissions Required

Twig requests:

  • Files.Read - Read files in OneDrive

  • Files.Read.All - Read all files accessible to user

  • offline_access - Maintain connection for syncs

Twig cannot:

  • Modify files

  • Delete files

  • Share files

  • Upload files

Data Security

  • Files are encrypted in transit and at rest

  • OAuth tokens are securely stored

  • Original files remain in OneDrive

  • You control access via Microsoft settings

Organizational Policies

Work/school accounts may have:

  • Admin approval requirements

  • Third-party app restrictions

  • Data Loss Prevention (DLP) policies

  • Conditional access policies

If blocked: Contact your IT administrator to approve Twig AI.

Revoking Access

To disconnect:

  1. In Twig: Delete the data source

  2. Find "Twig AI" and remove access

Troubleshooting

Authentication Failed

Problem: Can't connect OneDrive

Solutions:

  • Verify correct Microsoft account

  • Check if organizational admin approval needed

  • Try clearing browser cache/cookies

  • Ensure OneDrive is accessible

  • Check if account is locked or suspended

Admin Approval Required

Problem: "Admin approval required" error

Solutions:

  • Contact IT administrator

  • Request approval for Twig AI application

  • Provide app details: Microsoft Graph API permissions

  • May need Global Admin to grant consent

  • Alternative: Use personal OneDrive account

No Files Found

Problem: Sync completes but no files imported

Solutions:

  • Verify path is correct (case-sensitive)

  • Check authenticated account has access

  • Ensure folder contains supported file types

  • Review fileTypes filter in parameters

  • Check maxFiles limit

Permission Denied

Problem: Some files fail to import

Solutions:

  • Verify access to all files in folder

  • Check for encrypted files (may not be accessible)

  • Review DLP policies blocking access

  • Ensure files aren't in process of being uploaded

  • Check for corrupted files

Slow Syncs

Problem: Syncs take very long

Solutions:

  • Reduce scope with more specific path

  • Lower maxFiles limit

  • Set recursive: false if deep folders not needed

  • Filter by fileTypes

  • Check OneDrive API rate limits

Missing Recent Updates

Problem: Recent changes not appearing

Solutions:

  • Verify OneDrive sync completed (green checkmark)

  • Check last Twig sync date

  • Manually trigger refresh

  • Review process logs for errors

  • Ensure file saved properly in OneDrive

Advanced Configuration

Syncing Multiple Folders

Create separate data sources:

Date-Based Filtering

Recent files only:

Limiting Folder Depth

Avoid deeply nested folders:

OneDrive vs SharePoint

Use OneDrive when:

  • Syncing personal or individual files

  • Small team collaboration

  • Personal Microsoft accounts

  • Simple folder structures

Use SharePoint when:

  • Enterprise document management

  • Department-wide knowledge bases

  • Complex permissions and workflows

  • SharePoint-specific features (lists, libraries)

Monitoring & Maintenance

Regular Checks

Weekly:

  • Verify last sync completed

  • Check file count trends

  • Review error logs

Monthly:

  • Audit synced folders

  • Update folder paths if structure changed

  • Remove outdated data sources

Metrics to Track

  • Files Synced: Total file count

  • Last Sync Date: When sync last ran

  • Sync Duration: Processing time

  • Error Count: Failed imports

  • Storage Used: Indexed data size

Next Steps

After connecting OneDrive:

  1. Optimize folder structure

  2. Expand to additional folders

Support

For Microsoft/OneDrive issues:

  • Microsoft Graph API: https://docs.microsoft.com/graph

  • OneDrive Support: https://support.microsoft.com/onedrive

  • Microsoft 365 Admin Center: https://admin.microsoft.com

For Twig integration:

  • Check process logs for specific errors

  • Contact Twig support with error details

  • Provide folder paths and file types for troubleshooting

Last updated