Salesforce is notoriously in-famous for its low storage space and a relatively lacking document management capabilities. To be fair the Software-as-a-Service CRM platform was not aimed at replacing enterprise document management systems. Therefore most enterprises and organization that creates and consume a lot of documents, rely on external document management solutions, and then integrate them with Salesforce to make it easier for using the two systems.
SharePoint, a feature-stuffed Microsoft powered document management systems, is one such popular solution that enterprises rely on managing and securing their documents. For making business processes smoother and making all files available on a single interface, integrating Salesforce and SharePoint is a logical step for every organization using the two products. And it is also one of the most popular customization requests that we get every week.
Last year, in our previous post on integrating Salesforce with SharePoint, we discussed in detail on how one can connect the two solutions. We explored, with code, on how one can allow two-way communication between Salesforce and SharePoint through a custom Microsoft Azure hosted services.
At that time, Salesforce Files Connect was recently launched and its usage was not as widespread. Since then the inbuilt connection tool has gained more popularity, and hence the reason for this post.
In this post, we are going to look at how we can Integrate SharePoint and Salesforce easily using Files Connect.
What is Files Connect?
Integrating Salesforce with your document management solutions frees some actors from even accessing document management solutions and in general make your business process more smooth and easy. Keeping this in mind, and a growing demand for an easier integration method, Salesforce released Files Connect. It is a click and uses tool to integrate Microsoft and Google products with Salesforce, making the integration process a lot easier.
Files Connect gives your Salesforce instance ability to access files from external locations and use it in standard SFDC objects like Accounts and Cases, or custom Salesforce objects.
Files Connect for integrating cloud-based external data sources is available for all editions including Professional editions. However if you want to connect on-premise file sources, you must have Enterprise and above edition, and have to pay some additional costs.
Integrating Salesforce and SharePoint using Files Connect
The connection is easy to establish and easy to configure. The process starts with enabling Files Connect for the Salesforce instance and ends with accessing SharePoint Files in Salesforce.
Step 1: Enabling Salesforce Files Connect
The first step is enabling Files Connect in your instance. It’s fairly easy and straightforward. Go to
Build->Customize->Salesforce Files->Settings->Files connect. Or if you are lazy like me, you can find Files Connect in the quick find bar.
From there click on Edit, then select Enable Files Connect. The important thing here is the File Sharing setting. The ‘copy’ option is for those use cases when you have to share files with those Salesforce users that don’t have similar access to SharePoint or if you may have to share files with clients that don’t have access to SharePoint at all. ‘Reference’ is for use cases where you would want to reflect the same user access permissions in SFDC as done in SharePoint.
Step 2: User Access Permissions for Files Connect
The next step is to set up user permissions for Files Connect. If you use permission sets for managing user permissions, go to Permission Set->System Permissions->Edit, then Select “Files Connect Cloud”. Click Save.
If you are going for an on-premise SharePoint version like SharePoint 2010 or 2013, you would have to select “Files Connect On-Premises”. Again your licence should be higher than the professional version for this feature to even appear.
You can check which users has the above-configured permission set from the “Manage Assignments”. Make sure that all those users that you want to have access to SharePoint have the necessary permission set configured to their User Profile.
Another area that some people generally miss is to check the Files Connect Cloud permissions settings in the “Profile” section. Make sure that profile that your users are connected to have necessary permissions to access the tool.
Step 3: Creating an Auth Provider
Now that we have setup the necessary permissions, we need to set up the auth provider.
- Once again go to Quick Find in setup and find Auth. Provider. Once you are there click on “New”.
- Once there you would have to choose the “Provider Type”.
This is where the actual stuff happens. The word cloud confuses many in the term “Files Connect Cloud”. One would think that any service that is on cloud can be connected with SFDC, but that’s not true. Only the products from the companies that have partnered with Salesforce, like Facebook, Microsoft, Google, etc., or follow OpenID Connect protocols, can be connected with Salesforce files connect cloud. At the time of writing this blog the available connection companies include Facebook, Janrain, OpenID connect, LinkedIn, Twitter, Google and Github.
- Since we are connecting SharePoint, select Microsoft Access control Services.
- Enter the Name and URLSuffix, and for now, enter a dummy value for Consumer Key, Consumer Secret, Authorize Endpoint URL, and Token Endpoint URL (you may have to include HTTP:// for getting the URL fake values right.
- Once you click save, you would be directed to a Auth Provider Detail screen. This screen will have necessary details like “Callback URL”. You would need it for the next steps.
Step 4: Configuration in SharePoint
Login to your SharePoint instance and go to any Site Collection that you want to connect. Note down the site collection path, it would be useful later.
Now the main step is to create a small Microsoft 365 app.
- Go to the URL
https://[your company name].SharePoint.com/[site collection path]/_layouts/15/appregnew.aspx
- This will open an “App Information” page.
- Select “An app running on a web server”
- Click on Generate button in front of Client ID
- Similarly generate Client Secret.
- Title again is up to you.
- Now the app domain is your Salesforce domain. Check the subdomain of your SFDC instance and with that as the prefix, input the App Domain values.
- Redirect URL here is the callback URL that we generated in Salesforce in the previous step.
- Click Create. This will create a new app and redirect you to a new page that will display the newly generated and inputted values.
Step 5: SharePoint App Configuration
The next step is to configure the newly created app. Go to the following URL
https://[your company name].SharePoint.com/[site collection path]/_layouts/15/appinv.aspx
- This will open a new form.
- AppID here is the client ID that we generated in the previous step. So copy paste the values and click on Lookup.
This will auto-populate the values of other boxes except Permission Request XML. The value of Permission Request XML, as the title suggest, defines the level of access the connecting application will have in respecting to accessing SharePoint files collections. The standard input is
<AppPermissionRequests> <AppPermissionRequest Scope="SCOPE" Right="PLACEHOLDER"/> </AppPermissionRequests>
Where scope can be
- http://SharePoint/content/sitecollection/web – this lets SFDC users to access a single site collection, though you cannot access the subsites.
- http://SharePoint/content/sitecollection – This is used to allow access to single site collection along with all its subsites.
- http://SharePoint/content/tenant – This is used to allow access to all site collections.
Step 6: ReConfiguring Salesforce Files Connect
Now that we have created and configured our SharePoint App, we now have to reconfigure our Salesforce Files Connect settings, to be more precise, we need to change the dummy value we entered initially.
- Reopen Salesforce Files Connect.
- In the field of Consumer Key, enter the value corresponding with Client ID in SharePoint.
- Similarly, Consumer Secret here is Client Secret that we generated in SharePoint.
- In the field of Authorize Endpoint URL you would have to enter the value
https://[your company name].sharepoint.com/[site collection path]/_layouts/15/OauthAuthorize.aspx
- In the field of Token Endpoint URL, enter the value https://accounts.accesscontrol.windows.net/[your company name].onmicrosoft.com/tokens/OAuth/2?resource=00000003-0000-0ff1-ce00-000000000000/[your company name].sharepoint.[email protected][your company name].onmicrosoft.com
- You can use any name and label you like. However do remember the name name :). We would be using it later.
- Click Save
This have configured and created your Auth Provider in Salesforce.
Step 7: Creating External Data Source
The next step is to create an external data source in Salesforce.
- Goto Setup->Build->Develop->External Data Source
- Click on New External Data Source.
- In Type Select Files Connect: SharePoint Online.
- In the URL you can add SharePoint Site collection URL or the sub-site collection URL, whichever you are connecting with Salesforce.
- Identity Type is Per User.
- Authentication Protocol is OAuth 2.0
- In Authentication Provider, click on lookup. Select the Authentication Provider that we just created in earlier steps. [Told you to remember the name :)].
- Again you can use any name and label you like but it’s easier if you use similar names to authentication provider and other apps.
- Click Save.
Now that we have created the external data source, we have to enable it in permission set.
Step 8: Configuring Permission Sets
The next step is to edit permission set.
- Go to permission set->External Data Source->Edit
- Select and add the newly created data source to the Enabled External Data Source section.
- Click Save.
And that’s it you are done. Each of your user with same permission sets with now see SharePoint in External Files tab.
Files Connect for Google Drive, OneDrive and other stuff
This is a very straightforward integration method. Easy-to-do and easy to configure. The same method can be used to connect other products like Google Drive, Google Apps, One Drive etc., but require some tweaks. Maybe I will create another post for integrating Salesforce with OneDrive and Google Apps in future so stay tuned.