AdvoLogix Help

Creating a SharePoint Folder via Automation

Updated on

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 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.

  1. In Salesforce Setup, enter Flows in the Quick Find box, and select Flows.
  2. Select the New Flow action button in the page header to initiate a new Salesforce flow wizard.
  3. Switch to the All + Templates tab.
  4. Select SharePoint: Create Folder template from the list of available templates.
  5. 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.

Understanding Create Folder Flow Template Structure

  1. 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.

  2. Choose the Object you want your SharePoint folder be generated for.

  3. 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.

For example: 

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

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.

Previous Article Using the Secured Logins Manager
Next Article How do I auto-upload Salesforce Files to a SharePoint Folder via automation?
Still need help? Click here!
AdvoLogix® is a registered trademark of LLC a Texas Limited Liability Company. All references to other trademarks belonging to third parties that appear on this website, documentation, or other materials shall be understood to refer to those registered trademarks owned by others, and not to any trademark belonging to AdvoLogix. Otherwise, all material herein is the copyright of LLC. All Rights Reserved.