It is possible to use a different Named Credential to create folders on SharePoint and to configure the rights to the created folders on SharePoint. In this way, users can be prevented from changing the folder structure on SharePoint, which can result in File 365 no longer being able to find the folder. Instead, users can be granted ‘contribute’ rights in SharePoint on the created folder.
Configuration
To configure this, the following fields must be entered on the SObjectLocation records:
- ‘Force.com Named Credential (folder)’ (file365__SF_NamedCredentialFolder__c ): The name of the Named Credential to be used to create or modify folders on SharePoint. A different Named Credential is used for this than for working with Files.
- ‘Sharepoint SiteGroup Pattern’ (file365__SP_SiteGroupPattern__c): name or RegEx Pattern of the SiteGroup(s) on SharePoint that should be granted contribution rights to the directory.
Both fields are not (yet) found on the page layout and the component with which we create the SObjectLocations. This still has to be done ‘through the back door’, using the Salesforce Inspector plugin that allows you to see all fields, or via the Developer Console. If these fields are not filled in, the rights on SharePoint Folders will be unchanged: in that case, everything is done with the default Named Credential, and no additional rights on SharePoint folders are granted.
Example:
file365__SF_NamedCredentialFolder__c
file365__SP_SiteGroupPattern__c
Microsoft_File_365_Demo
Team Site Members
Note:
For the Sharepoint SiteGroup Pattern field, it is sufficient to simply add ” Members” to indicate the name of the SharePoint group that should be granted the “Contribute” rights.
View SharePoint settings
It is possible to view in SharePoint how the folder permissions are assigned. In SharePoint, click on the 3 dots next to the folder.
- Choose Manage Access.
- Again, in the pop up, click 3 dots at the top, and click Advanced Settings.
By default, folder permissions are inherited from its parent as illustrated below. The button “Stop Inheriting Permissions” indicates that the default settings are being applied.

Defining the folder permissions in the File 365 Object location, will override the default settings automatically.
Here’s an example of what the changed settings will look like in SharePoint. The button “Grant Permissions” and the displayed text “This folder has unique permissions” show that the default settings have been reconfigured.
