AdvoLogix provides a utility apex method to generate a SharePoint folder automatically via Salesforce Flows.
A background automation can be created for any object you want to generate the SharePoint folder for. AdvoLogix provides a Flow Template named SharePoint: Create Folder, which includes a preconfigured setup 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 as well as provide a different object to trigger the process.
- Choose the Trigger mechanism based on whether you want your folder 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 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. For example, it could be a field on the object or a formula variable within your flow to generate 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. It 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 SharePoint Site and to 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 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 Path 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.
USE CASE 1:
Considering your administrator has created a private library named as Firm Documents and the library contains a folder named as All Firm Contracts and that your new folder must be created within this folder only, then your Library and Folder Path may be setup as:
- Firm Documents/All Firm Contracts
USE CASE 2:
Considering your administrator want to use the default document library and the library contains a folder named as All Firm Contracts and that your new folder must be created within this folder only, then your Library and Folder Path may be setup as:
- Shared Documents/All Firm Contracts
The Create New Folder apex action can be utilized within Process Builder as well.