Introduction
S-Docs integrates seamlessly with Microsoft SharePoint, meaning that you can generate documents securely on the Salesforce platform and then upload them to SharePoint -- all without ever leaving Salesforce. This article provides step-by-step instructions for configuring the S-Docs SharePoint integration.
This article assumes that you have already created a SharePoint account.
Create A SharePoint App
Navigate to the following URL. Ensure you replace "your_domain" with your organization's SharePoint domain, and replace "Your_Site_Name" with your SharePoint site name (if applicable).
https://your_domain.sharepoint.com/sites/Your_Site_Name/_layouts/15/appregnew.aspx
You'll be presented with the following screen.
[1] Generate your Client Id and Client Secret. Copy both of these values and paste them somewhere you can access later.
[2] Choose a Title and App Domain. You can input whatever you'd like for these values, but ensure your App Domain is not written like a subdomain (do not include multiple periods within the domain).
[3] Set the Redirect URI to the following URL. Ensure you replace "your_salesforce_domain" with your organization's Salesforce domain (e.g. https://na123.salesforce.com).
https://your_salesforce_domain/apex/SDOC__SDRedirect?redirectPage=SDOC__SDAuth&service=sp
Copy your redirect URI and paste it somewhere you can access later.
[4] Click Create.
Add Add-In Permissions
Navigate to the following URL. Ensure you replace "your_domain" with your organization's SharePoint domain, and replace "Your_Site_Name" with your SharePoint site name (if applicable).
https://your_domain.sharepoint.com/sites/Your_Site_Name/_layouts/15/appinv.aspx
[1] Paste your Client ID into the App ID field and [2] click Lookup.
The other fields in the App Id and Title section will populate. Paste the following XML into the Permission Request XML field:
<AppPermissionRequests AllowAppOnlyPolicy="true"> <AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web/list" Right="FullControl"/> </AppPermissionRequests>
Then, click Create.
You'll be presented with the following screen.
[1] Ensure the Documents list is selected, then [2] click Trust It.
Authenticate With Salesforce & S-Docs
Next, you need to allow S-Docs and Salesforce to communicate with SharePoint.
Create Remote Site Settings
First, you need to create two new remote site settings.
From the setup menu, type "Remote Site Settings" into the Quick Find bar, click Remote Site Settings in the dropdown menu, then click New Remote Site.
Give your remote site a unique name; we recommend something similar to SharePoint.
Then, enter your SharePoint domain.
Ensure the Active checkbox is checked, then click Save & New. Enter the following values:
Remote Site Name: Refresh_Token_SharePoint_Site
Remote Site URL: https://accounts.accesscontrol.windows.net
Ensure the Active checkbox is checked, then click Save.
Provide S-Docs With Your SharePoint Credentials
To allow S-Docs to upload documents to SharePoint, you first need to provide S-Docs with your SharePoint domain, Redirect URI, Client ID, and Client Secret.
To do so, navigate to the Microsoft SharePoint Integration page. Click the App Launcher, type in "S-Docs," and click S-Docs Setup.
From the S-Docs Setup page, scroll down to the Other Pages section and click Go To Microsoft SharePoint Integration Page.
You'll be presented with the Microsoft SharePoint Integration page. Enter your SharePoint Client ID, Client Secret, site URL, and Redirect URI, then click Authorize Microsoft SharePoint Access.
You'll be redirected to Microsoft SharePoint. Click Trust It.
You'll be redirected to the SharePoint upload page. At this point, S-Docs is now authenticated with SharePoint.
Create A SharePoint Enabled S-Docs Template
To upload a document to Microsoft SharePoint, you must enable the template for SharePoint upload and optionally specify a SharePoint folder to upload to.
Add SharePoint Enabled Field to The Template Detail Page
From the setup menu, navigate to the Object Manager and find the SDoc Template object.
Navigate to the Page Layouts tab and click Edit for the SDoc Template layout.
Find the SharePoint Enabled field in the Fields section of the layout editor. Drag it down into the SDoc Template Detail section. Then, click Save.
Optional SharePoint Fields
You can also optionally add the SharePoint Folder Name field if you'd like to specify SharePoint folders to store uploaded documents in.
In addition, you can optionally add the Allow SharePoint Target Editing field if you'd like to grant end users the ability to modify which SharePoint folder a document should be uploaded to after generation.
Enable Your S-Docs Template for SharePoint Upload
Navigate to the template detail page for any templates you'd like to upload to SharePoint after generation, and check the SharePoint Enabled checkbox.
If you'd like to upload documents to a specific folder, you can also enter the folder name - or the path to the folder - in the SharePoint Folder Name field, as shown above.
If you'd like to grant end users the ability to modify this folder path, you can check Allow SharePoint Target Editing.
Upload Documents to Microsoft SharePoint
After generating your SharePoint-enabled template, click Upload Selected to Microsoft SharePoint.
Your document will be queued for upload, and you will be routed to the SharePoint upload page.
On this page, you can [1] view the SharePoint document library that your document is queued to upload to, as well as [2] the target folder. A pencil icon will appear if you opted to allow users to modify this field. You can also [3] remove any documents from the queue that shouldn't be included. Be sure to refresh the page after clicking Remove.
When satisfied with the SharePoint upload queue, [4] click Upload to Microsoft SharePoint.
Your document(s) will be uploaded to SharePoint, and the SharePoint Status field will present a link to view your document.
You can also view your document stored in SharePoint.
For more information about S-Docs integrations, please visit the Integrations section of the Knowledge Base.
Tags: Integrations, Microsoft