Auto-Create Folders on SharePoint

Prev Next

Administrators can configure the Auto-Create SharePoint Folders feature to enable automatic creation of SharePoint folders whenever a new object record is created. This ensures that each object record has a dedicated folder for storing related documents. 

Configuring a Record-Triggered Flow

This section outlines the steps to configure a Record-Triggered Flow in Salesforce to call the Invocable Apex class (TM_SP_AutoCreateRootFolderHelper). When a record is created or updated, the flow automatically creates and syncs the corresponding SharePoint folders linked to that record.

To create a Record-Triggered Flow:

  1. In your Salesforce organization, click the gear icon and select Setup.

  2. Use the Quick Find box to search and open Flows.

  3. Click New Flow.

  4. Select Record-Triggered Flow.
    The Flow Builder page appears.

  5. Under Select Object, select an object that will trigger the flow (example, Opportunity or Account).

  6. Under Configure Trigger, set the condition for when the flow should run.
    11-1.png

To add actions to the Flow:

  1. In the Flow Builder, click add Add icon_flows.png and select Action.
    11-2.png

  2. In the Search Actions box, locate and select TM_SP_AutoCreateRootFolderHelper.
    11-3.png

  3. On the TM_SP_AutoCreateRootFolderHelperaction configuration page, fill in the following details:

    • Label: Enter Create Root Folder Structure on Sharepoint.

    • APIName: Enter Create_Root_Folder_Structure_on_Sharepoint.

    • Object for "newRecordList": Select the triggering object (For example, Opportunity).

    • newRecordList: Select the triggering record. (For example, Triggering Opportunity).
      11-4.png

  4. Click Save.
    The save flow dialog box appears.

  5. On the Save the flow page, fill in the following details, and then click Save:

    • Flow Label:Auto Create Root Folder on Sharepoint Flow

    • Flow API Name:Auto_Create_Root_Folder_on_Sharepoint_Flow
      11-5.png

  6. Click Activate.
    11-6.png