AdvoLogix provides a utility apex method to generate a SharePoint folder automatically via Salesforce Flows.
Creating a Folder Upon Record Creation Via Flows
A background automation can be created for any object for which you want to generate the SharePoint folder. AdvoLogix provides a Flow Template named SharePoint: Create Folder, which includes a preconfigured set of actions needed to generate the folder.
- In Salesforce Setup, enter Flows in the Quick Find box and select Flows.
- Select the New Flow action button in the page header to initiate a new Salesforce flow wizard.
- Switch to the All + Templates tab.
- Select SharePoint: Create Folder template from the list of available templates.
- Select the Next button.
You now have a custom flow that will be triggered when a record is created or edited. Your administrator can update the triggering option and provide a different object to trigger the process.
Understanding Create Folder Flow Template Structure
- Choose the Trigger mechanism based on whether you want your folder to be generated whenever a record is created or updated. The Run Flow mechanism should remain with the default selection, as you would want to be able to initiate workspace creation after the Salesforce record has been saved and committed to the database.
- Choose the Object you want your SharePoint folder to be generated for.
- Execute Create Folder Apex Action provided by AdvoLogix as a SharePoint utility method. The Create Folder Apex method supports the following parameters:
- Folder Name - [required] Provide a folder name value here. It could be a field on the object or a formula variable within your flow that generates a folder name dynamically when it is executed.
- Record ID - [required] Provide the current record's record ID value here.
- Folder Template ID - Provide a folder template's record ID value here. This will be used to generate a set of subfolders within this newly created folder in SharePoint.
- Library and Folder Path - Provide the relative path between the SharePoint Site and where your new folder is to be created.
- Site Address - Provide the SharePoint Site Address here. (See how to retrieve your SharePoint Site Address)
- Login As User ID - [optional] Provide a user ID (that is enabled as a Secured Logins user) to automatically authenticate your SharePoint-related operations within this flow action. (For more details about this Apex Action, see this article.)
- Use Asynchronous Method - Provide a true/false value to let the service know that this process is to be executed as an asynchronous approach (default value is false).
Library and Folder Paths should always start with your document library name. By default, all SharePoint sites have a shared document library named Shared Documents. If your administrator has created other document libraries then you may enter any other document library name here along with your path to the newly created folder.
For example:
USE CASE 1:
Considering your administrator has created a private library named Firm Documents and the library contains a folder named All Firm Contracts, and that your new folder must be created within this folder only, then your Library and Folder Path may be set up as:
- Firm Documents/All Firm Contracts
USE CASE 2:
Considering your administrator wants to use the default document library and the library contains a folder named All Firm Contracts and that your new folder must be created within this folder only, then your Library and Folder Path may be set up as:
- Shared Documents/All Firm Contracts
The Create New Folder apex action can also be utilized within Process Builder.