Salesforce SharePoint Integration by Connecting Records Using Microsoft Graph API

Article Written By:
Varalatchumi Veerasamy
Created On:

October 12, 2026

Salesforce SharePoint integration linking Salesforce records to SharePoint folders through Microsoft Graph API

Salesforce SharePoint integration links your CRM records to the documents your teams keep in SharePoint. With the Microsoft Graph API, each Salesforce record can have its own SharePoint folder, created and filled from Salesforce. Users open the right contract or proposal from the record page. The files stay in SharePoint. A Graph-based build lets you:

  • Create a SharePoint folder for every new account, opportunity, or case
  • Upload files from Salesforce into the matching SharePoint folder
  • Show SharePoint documents on the Salesforce record page
  • Sync changes made in SharePoint back to Salesforce
  • Keep large files out of Salesforce storage and in SharePoint

Picture an account manager who just closed a large deal. The signed contract, the pricing sheet, and the onboarding plan all live in SharePoint. Before the integration, she hunted through shared folders and pasted links into Salesforce notes. Now a folder named after the opportunity appears as soon as someone creates the deal. Every file is one click away on the record.

This guide shows how the Microsoft Graph API connects Salesforce records with SharePoint. It also covers secure sign-in and the limits to plan for. If you'd rather have experts build it, our Salesforce integration services team can design and deliver it with you.

‍

What Is Microsoft Graph API Salesforce Integration?

Microsoft Graph is Microsoft's single API for Microsoft 365 data, including SharePoint Online, OneDrive, Outlook, and Teams. All calls go through one address: graph.microsoft.com. In a Microsoft Graph API Salesforce integration, Salesforce calls Graph to read, create, and update SharePoint files and folders.

Here's the basic idea. Salesforce holds the customer record. SharePoint holds the documents. Graph is the bridge that lets Salesforce ask SharePoint to make a folder, store a file, or list what's inside.

That makes it a strong fit for SharePoint Online Salesforce integration projects that need more than read-only links. With Graph, you control:

  • Where files go, such as one folder per record
  • When actions happen, such as on record creation or stage change
  • Who can see what, through Microsoft 365 permissions
  • How changes flow back, through change tracking

Microsoft also offers an older SharePoint REST API. Graph is Microsoft's newer, unified option. It also covers other Microsoft 365 services. The same connection can later grow into a wider Salesforce Microsoft 365 integration with Outlook or Teams. For most new SharePoint REST API Salesforce builds, Graph is the simpler place to start.

‍

Salesforce SharePoint Connector Options Compared

There's more than one way to integrate SharePoint with Salesforce. The right choice depends on how much control and automation you need. Salesforce Ben's guide to connecting Salesforce and SharePoint groups the options similarly.

OptionWhat It Does WellWhere It Falls ShortBest For
Salesforce Files ConnectFree, built-in view of SharePoint filesMostly read-only; little automationTeams that only need to browse and link files
AppExchange connectorReady-made folders, uploads, and Flow actionsPer-user license cost; less design controlTeams that want fast setup without code
Middleware or iPaaSMoves files and data between systems by rulesOne more platform to build and runTeams that already use an integration platform
Custom Microsoft Graph API buildFull control of folders, uploads, sync, and securityNeeds developer time and upkeepTeams with custom records or strict rules

If you're starting small, Files Connect, the built-in Salesforce external file integration, may be enough. Our guide to setting up Salesforce Files Connect for SharePoint walks through it. For a look at ready-made apps, see our list of the best tools to integrate Salesforce files with SharePoint.

A custom Graph build makes sense when your process doesn't fit a packaged app. Think custom objects, special folder rules, or files with strict retention plans. For Salesforce document automation, it's also the most flexible SharePoint Salesforce integration. For example, it can create folders when a deal reaches a new stage.

‍

How Salesforce Records Connect With SharePoint

The heart of a Graph-based design is a clear link between each Salesforce record and one SharePoint location. Most teams use a folder-per-record pattern.

The Folder-Per-Record Pattern

When a user creates an account, opportunity, or case, Salesforce asks Graph to create a matching folder. Graph returns a unique ID for that folder, called a driveItem ID. Salesforce saves this ID in a custom field on the record.

From then on, Salesforce never has to search for the folder by name. It uses the saved ID, which keeps working even if someone renames the folder in SharePoint.

A Simple Folder Structure

Keep the structure predictable so both systems stay easy to manage:

  • One document library per object or business unit, such as "Accounts" or "Opportunities"
  • One folder per record, named with the record name plus its Salesforce ID
  • Optional subfolders for document types, such as Contracts, Proposals, and Invoices

Adding the Salesforce ID to the folder name prevents clashes when two records share a name. It also helps admins find the right folder during support checks.

Salesforce Document Management Integration on the Record Page

A Lightning web component on the record page lists the files in the linked folder. Users get Salesforce SharePoint file access without leaving the record. They can open, upload, or download files in one place. This turns Salesforce records with SharePoint into a single workspace for sales, service, and finance teams.

‍

Microsoft Graph API SharePoint Setup in Six Steps

Here's the high-level flow for a Microsoft Graph API SharePoint build. Exact screens change over time, so follow the latest Microsoft and Salesforce docs for each click.

  1. Register an app in Microsoft Entra ID. Create an app registration for Salesforce. Note the tenant ID and client ID, and create a client secret or certificate.
  2. Grant Graph permissions. Add the Microsoft Graph permissions your build needs, then have a Microsoft 365 admin grant consent. Pick the narrowest scope that works (see the next section).
  3. Store credentials in Salesforce. Create an external credential and a named credential that point to Microsoft's sign-in service and graph.microsoft.com.
  4. Create folders from Salesforce. Use Apex, called from a Flow or trigger, to create the record's folder and save the returned folder ID.
  5. Upload and list files. Add Apex methods to upload files into the folder and list its contents.
  6. Build the user experience. Add a Lightning web component to record pages so users can work with files in one place.

Test the whole flow in a Salesforce sandbox and a test SharePoint site before you go live.

Salesforce SharePoint Authentication and OAuth

Authentication is where many Microsoft Graph API integration projects go wrong, so plan it early.

For background jobs, such as creating folders when users save records, most teams use the OAuth 2.0 client credentials flow. Salesforce signs in as the app itself, not as a person. For actions where SharePoint must check each user's own rights, a per-user sign-in flow fits better.

On the Salesforce side, use named credentials for every Graph callout. The Salesforce Developers guide to named credentials for Apex callouts explains why. Salesforce handles the sign-in, so secrets never appear in your code. Salesforce Codex also covers how to work with external credential parameters in Apex if your team needs custom settings.

For permissions, Microsoft offers a scope called Sites.Selected. It gives the app access only to the SharePoint sites you choose, instead of every site in your tenant. An admin first consents to the scope. Then the admin assigns the app a read or write role on each chosen site. This is the safest default for a Salesforce OAuth integration with SharePoint.

‍

Salesforce SharePoint Document Sync

Creating folders and uploading files covers the Salesforce-to-SharePoint direction. A full Salesforce SharePoint document sync also brings SharePoint changes back.

Track Changes With Delta Queries

Graph offers a delta query for document libraries. The first call returns every item and a saved link, called a deltaLink. Later calls with that link return only what changed since the last check, including new, edited, and deleted files.

A scheduled Apex job can call the deltaLink every few minutes. It then updates Salesforce, such as a file count on the record or a "last document added" date. Microsoft notes that delta is the most reliable way to read every change in a library.

Get Alerts With Change Notifications

Graph can also send change notifications when a library changes. Salesforce receives the alert, then runs a delta call to get the details. This cuts down on constant polling and keeps SharePoint file synchronization close to real time.

Handle Large Files the Right Way

Graph supports simple uploads for files up to 250 MB. Microsoft recommends upload sessions for anything over 10 MiB. An upload session sends the file in parts, called fragments, and can resume if the connection drops.

Each fragment must be smaller than 60 MiB and a multiple of 320 KiB. Microsoft suggests 5 to 10 MiB per fragment. This matters for Salesforce, because Apex has its own size limits, covered in the next section.

‍

Salesforce File Management Limits to Plan For

Good Salesforce file management starts with knowing the limits on both sides. Like any Salesforce API integration, a Graph build has to work within them. These numbers come from Salesforce and Microsoft documentation.

LimitValueWhat It Means for Your Build
Apex callout request or response size6 MB synchronous, 12 MB asynchronousLarge files can't pass through Apex in one call
Apex callouts per transaction100Batch folder and file work across jobs
Apex callout timeout10 seconds by default, 120 seconds maximumSet longer timeouts for upload calls
Graph simple uploadUp to 250 MBFine for direct uploads outside Apex
Graph upload sessionRecommended over 10 MiBSend big files in fragments
Upload session fragmentUnder 60 MiB, multiple of 320 KiBSize fragments to fit Apex limits
Graph throttlingHTTP 429 with a Retry-After headerWait and retry instead of failing

The key takeaway is simple. Apex works well for folders, metadata, and small files. For large files, many teams have the browser upload straight to the Graph upload session URL. That keeps big files out of Apex entirely.

If you're new to Apex callouts, Trailhead's Apex Integration Services module is a good primer for your developers.

Throttling also deserves a plan. When Graph returns HTTP 429, your code should wait for the time in the Retry-After header and try again. Delta queries and change notifications also help you avoid throttling.

‍

CRM Document Management Best Practices

A Graph build gives you full control. These habits keep your CRM document management clean over time.

Use the narrowest permissions. Start with the Sites.Selected scope, limited to the sites Salesforce needs. Avoid tenant-wide scopes unless there's a clear reason.

Save IDs, not paths. Store the SharePoint folder ID on each Salesforce record. IDs keep working when people rename or move folders.

Plan secret rotation. Client secrets expire. Set a reminder to rotate them, or use certificates for longer-lived access.

Log every callout. Write errors to a custom log object in Salesforce. Your admins can then spot failed uploads before users report them.

Keep SharePoint as the file owner. Let SharePoint document management handle versions, retention, and sharing. Salesforce shows and links the files rather than storing copies, which keeps Salesforce document storage low.

Respect user access. If some documents are sensitive, use a per-user sign-in for viewing. That way, Salesforce file sharing follows each person's SharePoint rights.

Start with one object. Launch with accounts or opportunities first. Add cases, custom objects, and sync once the first flow runs cleanly.

A well-run CRM and SharePoint integration also supports enterprise document management goals, such as audit trails and retention rules. For the bigger business picture, read our post on why Salesforce SharePoint integration matters for enterprise growth. Our step-by-step Salesforce SharePoint integration guide also covers common pitfalls.

Our team has built document integrations on Salesforce before, including DocuSign integration for document generation and SpringCM for contract storage. The same principles apply to SharePoint: clear ownership, secure access, and files tied to the right record.

‍

Frequently Asked Questions

1. What is Salesforce SharePoint integration?

Salesforce SharePoint integration connects Salesforce records to documents stored in SharePoint. Users can open, upload, and manage SharePoint files from inside Salesforce. Files stay in SharePoint, which saves Salesforce storage and keeps one source of truth.

2. How does the Microsoft Graph API connect Salesforce to SharePoint?

Salesforce sends secure calls to Microsoft Graph, Microsoft's API for Microsoft 365 data. Graph then creates folders, uploads files, or lists documents in SharePoint. Salesforce stores the returned folder ID on each record to keep them linked.

3. Can I integrate SharePoint with Salesforce without code?

Yes. Salesforce Files Connect and several AppExchange apps offer no-code options. A custom Graph build needs developers but gives you full control over folders, sync, and security.

4. Is Microsoft Graph better than the SharePoint REST API for Salesforce?

For most new builds, yes. Graph is Microsoft's unified API and works across SharePoint, OneDrive, Outlook, and Teams. The SharePoint REST API still works, but Graph keeps your integration ready for other Microsoft 365 needs.

5. Which Graph permissions does a Salesforce SharePoint integration need?

It depends on what the build does. Sites.Selected is the safest choice for app-only access, since it limits Salesforce to the sites you pick. An admin must grant consent and assign a read or write role on each site.

6. Can Salesforce and SharePoint sync documents both ways?

Yes. Salesforce can create folders and upload files through Graph. To bring SharePoint changes back, use Graph delta queries, often paired with change notifications.

‍

Connect Every Salesforce Record to the Right SharePoint Folder

With Graph, Salesforce SharePoint integration gives every record a home for its files. Folders appear automatically, files upload from the record page, and changes flow back. Your teams spend their time with customers, not in shared drives.

Minuscule Technologies has built on Salesforce since 2014. Our team has 125+ certified Salesforce experts and 75+ projects worldwide. Do your lenders keep loan files in SharePoint? Our Loan Lifecycle Visibility accelerator tracks each loan from start to payout in Salesforce. Our Industry Starter Packs also give your team a ready-made base to build on.

Ready to link your Salesforce records with SharePoint? Book a Salesforce SharePoint integration consultation with our team. We'll review your document process, design the right Graph setup, and plan a secure rollout.

Contact Us for Free Consultation
Thank you! We will get back in touch with you within 48 hours.
Oops! Something went wrong while submitting the form.

Ready to Architect Your Salesforce Success?

You've seen what's possible. Now, let's make it happen for your business. Whether you need an end-to-end Salesforce solution, a complex integration, or ongoing managed services, our team is ready to deliver.

Schedule a Free Strategic Call