Microsoft SharePoint

Connect your Microsoft SharePoint sites to sync document libraries, lists, and pages into your Twig AI knowledge base for enterprise-wide knowledge management.

Overview

Property
Details

Type

Dynamic

Refresh

Scheduled (Daily, Weekly, Monthly)

Tier

2 (Professional & Enterprise)

Authentication

OAuth 2.0 (Microsoft)

Content Types

Document libraries, pages, lists

When to Use SharePoint Connector

The SharePoint connector is ideal for:

  • Enterprise Knowledge Management - Department or company-wide content

  • Document Libraries - Structured document repositories

  • Team Sites - Collaborative team workspaces

  • Intranet Content - Internal communication and resources

  • Compliance-Required Storage - Regulated document management

  • Large-Scale Deployments - Enterprise Microsoft 365 environments

Supported Content Types

Document Libraries

  • Office documents (Word, Excel, PowerPoint)

  • PDF files

  • Text documents

  • Images with text

  • Templates and forms

SharePoint Pages

  • Modern pages and news

  • Wiki pages

  • Site pages

  • Web parts content

Lists (Limited)

  • List items with text fields

  • Metadata and descriptions

  • Announcements

Prerequisites

Before setting up:

  • SharePoint Online (Microsoft 365)

  • Site access (Member or Owner permissions)

  • Organizational Microsoft account

  • Admin approval for OAuth (if required)

How to Set Up SharePoint Connector

Step 1: Gather SharePoint Information

You'll need:

  1. Site URL - Your SharePoint site address

  2. Document Library Name - Name of library to sync (optional)

  3. Microsoft Account - With access to the site

Step 2: Find Your SharePoint Site URL

Your SharePoint URL follows this pattern:

Examples:

  • https://contoso.sharepoint.com/sites/engineering

  • https://acmecorp.sharepoint.com/sites/hr

  • https://company.sharepoint.com/sites/projectalpha

To find your site URL:

  1. Navigate to your SharePoint site

  2. Copy the URL from your browser address bar

  3. Use only up to /sites/[sitename] (don't include library or page paths)

Step 3: 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-Sharepoint from the list

  5. Note: Available on Professional and Enterprise plans

Step 4: Configure Basic Information

  • Name (required): Descriptive name

    • Example: "Engineering Site", "HR Document Library", "Product Team Site"

  • Description (optional): Additional context

    • Example: "Engineering team SharePoint with technical documentation"

  • Tags (optional): Organization tags

    • Examples: "sharepoint", "engineering", "internal"

Step 5: Authenticate with Microsoft

  1. Click Connect SharePoint or Authorize

  2. You'll be redirected to Microsoft login

  3. Sign in with your organizational account ([email protected])

  4. Review requested permissions:

    • Read SharePoint items - Access to site content

    • Read site collections - Browse sites

    • Read user profiles - User information

  5. Admin approval may be required

  6. Click Accept

  7. You'll be redirected back to Twig

Step 6: Configure Site and Library

Site URL (Required)

Parameters (JSON)

Available Parameters:

Parameter
Type
Description
Default

siteUrl

String

SharePoint site URL (required)

-

libraryName

String

Document library name

"Documents"

includeFolders

Array

Specific folders to sync

All

excludeFolders

Array

Folders to skip

None

fileTypes

Array

File extensions to include

All

includePages

Boolean

Sync SharePoint pages

true

includeLists

Boolean

Sync list items

false

recursive

Boolean

Include subfolders

true

maxFiles

Number

Maximum files to sync

2000

modifiedAfter

String

Only files after date (YYYY-MM-DD)

All

Step 7: Test Connection

  1. Click Test Config or Test Connection

  2. Twig will verify:

    • Site URL is valid and accessible

    • Authentication has proper permissions

    • Library/folders can be accessed

  3. Review test results

  4. Fix any errors before proceeding

Step 8: Set Refresh Schedule

Choose sync frequency:

  • Never - Manual sync only

  • Daily - Sync changes daily (recommended for active sites)

  • Weekly - Sync weekly (standard for most sites)

  • Monthly - Sync monthly (for stable content)

Step 9: Save and Sync

  1. Click Save or Create

  2. Initial sync begins automatically

  3. Monitor progress in data sources list

  4. Check process logs for any errors or warnings

Finding SharePoint Library Names

Default Libraries

Most SharePoint sites have these standard libraries:

  • Documents - Default document library

  • Site Pages - Modern pages

  • Site Assets - Images and files

  • Shared Documents - Shared files

Finding Custom Library Names

Method 1: From SharePoint UI

  1. Navigate to your SharePoint site

  2. Click on the library in the left navigation

  3. The library name appears in the page title and URL

Method 2: From URL

Method 3: Site Contents

  1. Go to Site Contents (gear icon → Site Contents)

  2. All libraries are listed with their names

Configuration Examples

Example 1: Team Site Documents

Example 2: Specific Folder Only

Example 3: Multiple Libraries (Create Separate Sources)

Example 4: Pages and Documents

Best Practices

1. Start with Specific Libraries

Rather than syncing entire site:

2. Use Folder Filtering

Focus on relevant content:

3. Filter by File Type

Optimize for AI-readable content:

Avoid:

  • Media files (unless needed)

  • Executables

  • Archives

4. Set Appropriate Scope

Good (Focused):

Avoid (Too Broad):

5. Sync Multiple Sites Separately

Create individual data sources for different sites:

  • Engineering Site

  • HR Site

  • Product Site

  • Marketing Site

Better organization and easier management.

6. Consider Permissions

  • Only sync libraries accessible to all team members

  • Avoid syncing restricted/confidential content

  • Create agents with appropriate access controls

  • Review content before making available to AI

7. Handle Large Sites

For sites with many files:

  • Set maxFiles limit

  • Use modifiedAfter for recent content

  • Sync specific folders only

  • Create multiple focused data sources

Understanding Sync Behavior

Initial Sync

  • Scans entire library/folders

  • Downloads all matching files

  • Processes SharePoint pages

  • May take significant time for large libraries

Incremental Syncs

  • Detects files modified since last sync

  • Syncs only new or changed content

  • Much faster than initial sync

  • Tracks file metadata for changes

What Gets Synced

Synced:

  • New files added to library

  • Modified file content

  • Updated pages

  • New pages

  • Files moved into synced folders

  • Renamed files (as new files)

Not Synced:

  • Deleted files (remain in Twig until cleanup)

  • Files in recycle bin

  • Files without read permission

  • Checkout files (locked for editing)

  • System files and folders

Content Processing

Documents:

  • Word, Excel, PowerPoint → Text extraction

  • PDF → Text extraction

  • HTML pages → Content extraction

SharePoint Pages:

  • Modern pages → Full content

  • Text web parts → Extracted text

  • Links and references → Captured

Lists:

  • List items → Title and text fields

  • Metadata → Included if relevant

Permissions & Security

OAuth Permissions Required

Twig requests:

  • Sites.Read.All - Read SharePoint sites and content

  • Files.Read.All - Read files in document libraries

  • User.Read - Read user profile information

Twig cannot:

  • Modify files or pages

  • Delete content

  • Change permissions

  • Share files

  • Create new content

SharePoint Permissions

The authenticated user must have:

  • Read access to site

  • Read access to document libraries

  • Member or Visitor role on site

Tenant-Level Considerations

  • Admin may need to approve app

  • Conditional Access policies may apply

  • DLP policies may restrict content

  • Information barriers may limit access

If blocked: Contact SharePoint/Microsoft 365 administrator.

Revoking Access

To disconnect:

  1. In Twig: Delete the data source

  2. In SharePoint: Site Settings → Site App Permissions

  3. Remove "Twig AI" access

Troubleshooting

Site Not Found

Problem: Can't connect to SharePoint site

Solutions:

  • Verify site URL is correct and complete

  • Ensure site exists and is not deleted

  • Check you have access to the site

  • Try accessing site in browser first

  • Verify tenant URL (might be .sharepoint.com vs .sharepoint.us)

Authentication Failed

Problem: OAuth authentication fails

Solutions:

  • Use organizational account (not personal)

  • Ensure account has site access

  • Check if admin approval is required

  • Try re-authenticating

  • Clear browser cache/cookies

Library Not Found

Problem: Can't access specified library

Solutions:

  • Verify library name is exact match (case-sensitive)

  • Check library exists on the site

  • Ensure you have read permission to library

  • Try "Documents" (default library name)

  • Look in Site Contents for library name

No Files Synced

Problem: Sync completes but no files imported

Solutions:

  • Verify library contains supported file types

  • Check fileTypes filter isn't too restrictive

  • Review includeFolders paths

  • Ensure files aren't checked out (locked)

  • Look for permission issues in process logs

Permission Denied Errors

Problem: Some files fail to sync

Solutions:

  • Check file-level permissions

  • Verify not in restricted folder

  • Ensure files aren't checked out

  • Review DLP policies

  • Look for encrypted/IRM-protected files

Slow Syncs

Problem: Syncs take very long time

Solutions:

  • Reduce maxFiles limit

  • Use more specific includeFolders

  • Set recursive: false if appropriate

  • Filter by fileTypes

  • Split into multiple smaller data sources

  • Check SharePoint throttling/performance

Missing Recent Changes

Problem: Recent updates not appearing

Solutions:

  • Check last sync date in Twig

  • Verify file is checked in (not draft)

  • Manually trigger refresh

  • Review process logs for errors

  • Ensure SharePoint sync completed

Advanced Configuration

Multi-Site Setup

Sync multiple SharePoint sites:

Hub Site Architecture

For hub-associated sites:

  • Sync each site separately

  • Use consistent naming convention

  • Tag with hub association

  • Create hub-level AI agents

Metadata Filtering

While not directly supported, you can:

  1. Organize files by folder based on metadata

  2. Use folder filtering to sync specific types

  3. Leverage SharePoint views to identify content

Content Type Filtering

Focus on specific SharePoint content types:

  • Sync only document libraries (not lists)

  • Include pages for intranet content

  • Skip media libraries

SharePoint vs OneDrive

Use SharePoint when:

  • Enterprise-wide knowledge management

  • Multiple team sites

  • Complex permissions and workflows

  • Department or company-level content

  • Integration with other SharePoint features

Use OneDrive when:

  • Personal or small team files

  • Individual user documents

  • Simpler file structures

  • Personal Microsoft accounts

Monitoring & Maintenance

Regular Checks

Weekly:

  • Verify last sync completed

  • Check file count trends

  • Review any error logs

  • Ensure new content is syncing

Monthly:

  • Audit synced libraries

  • Update folder filters if structure changed

  • Review permissions and access

  • Check for outdated content

Quarterly:

  • Assess AI usage of SharePoint content

  • Optimize sync configuration

  • Review and cleanup old data sources

Metrics to Track

  • Files Synced: Total document count

  • Pages Synced: SharePoint pages indexed

  • Last Sync: When sync last ran successfully

  • Sync Duration: Processing time

  • Error Rate: Percentage of failed imports

  • Storage Used: Indexed data size

Enterprise Best Practices

1. Governance

  • Document which sites are synced

  • Define naming conventions

  • Establish refresh schedules

  • Set retention policies

  • Review access regularly

2. Security

  • Use service accounts for production

  • Implement least-privilege access

  • Audit AI access to sensitive content

  • Review compliance requirements

  • Monitor for data leaks

3. Performance

  • Limit sync scope appropriately

  • Stagger refresh schedules across sources

  • Monitor API throttling

  • Use folder filters effectively

  • Split large libraries

4. Change Management

  • Communicate with site owners

  • Document synced libraries

  • Plan for SharePoint migrations

  • Update configurations after restructures

Next Steps

After connecting SharePoint:

  1. Optimize folder structure and filters

  2. Expand to additional sites

Support

For SharePoint/Microsoft issues:

  • SharePoint Online: https://docs.microsoft.com/sharepoint

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

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

For Twig integration:

  • Check process logs for specific errors

  • Contact Twig support with site URL and library details

  • Provide permission details if access issues

  • Share error messages for troubleshooting

Last updated