Using Salesforce and want to connect OneDrive or Sharepoint online?

If you are using Salesforce and OneDrive for Business or Sharepoint Online, you can connect the two systems using the Salesforce Files Connect feature.  This will allow your users to attach Files using the Files feature on records OR using Chatter Files.  Users can search their OneDrive or Sharepoint and attach them to Salesforce records.  Note this is a file-based feature, you cannot link a directory to a Salesforce record.


A good step by step guide to setting it up can be found here.


There are a lot of steps involved, here’s a summary:

  1. In Salesforce:
    • Enable Files Connect:
      • The File Sharing option allows you to select Reference or Copy, use this if you want to create a copy of the file in Salesforce but note the security and file storage implications in Salesforce.
    • Create a Permissions Set for access to OneDrive or Sharepoint files.
      1. User License must be set to “None.”
      2. Edit the System Permissions and check “Files Connect Cloud”.
      3. Assign this Permissions Set to your Users.
    • Setup an Auth.Provider in Salesforce following the instructions for the Alternate Method described in the document linked above:
      • At this step we are setting up with placeholder values only, we’ll update them later.
    • Provide the Callback URL you generated in the above step to your OneDrive/Sharepoint administrator.
      • Tip: be sure to provide them with the Salesforce domain, in our case that is, a standard Salesforce domain will include, ie – you can see this in your browser URL when logged into Salesforce.
  2. In OneDrive or Sharepoint:
    • Have the OneDrive/Sharepoint  administrator follow the steps in the document linked above – pages 10 & 11
    • They will return you a set of information you will use in the next step.
  3.  In Salesforce:
    • Update your Auth.Provider entry with the following supplied by your OneDrive/Sharepoint administrator:
      • Consumer Key = Client ID
      • Consumer Secret = Client Secret and
      • Authorize Endpoint URL = Follow the format that is stated in the step by step guide page 12 for OneDrive/SharePoint
      • Token Endpoint URL = Follow the format that is stated in the step by step guide page 12 for OneDrive/SharePoint
    • Create an External Data Source:
      • Don’t see the Type “Microsoft OneDrive for Business”?  Check out this knowledge article for a tip on fixing that issue.
      • Specify the Identity Type:
        • Per User to force each Salesforce User to authenticate to OneDrive/Sharepoint OR
        • Named Principal to use a single login to OneDrive/Sharepoint.
      • Check the box “Start Authentication Flow on Save”, login to OneDrive/Sharepoint and test the connection.
      • Site URL: your OneDrive/Sharepoint URL e.g.
        • OneDrive:
        • SharePoint:
    • Identity Type = Per User?
      • Have each Salesforce User setup their authentication credentials for OneDrive/Sharepoint  – under settings search for authentication and create a new entry for OneDrive/Sharepoint.
      • This can also be created when the User logs into Sharepoint as prompted in Salesforce (see Page 27 of the linked guide):
    • If Identity Type is  Per User,
      • Return to the Permission Set that you have created earlier on. In the Apps section, click External Data Source Access and include the External Data Source that you have created previously OR
      • Go to the Profile and include the External Data Source under the Enabled External Data Source Access related list.


The Salesforce interface looks like this:



Tips when it’s not working:

  • The URL entries for OneDrive/Sharepoint are in the documentation and are VERY specific, follow them exactly, only substituting where necessary, double check these if you are not authenticating.
  • Unable to view a Sharepoint PDF in Salesforce, but .doc and .xls are fine?  At the time of this blog, this functionality isn’t available, you’ll need to download the file and then view.