The Create folder flow action creates a folder in a desired destination on any cloud storage. This means you can automatically create folders in Google Drive, SharePoint, OneDrive etc. The result? Instant folder creation without the hassle of manual setup.
The Create folder action requires the following parameters -
- Library - The desired library where the file must go (e.g. Google Drive)
- Destination parameters - Various parameters that specify where the folder must be created
- Folder name - Final name of the folder that can be specified using Salesforce merge fields
In this article we show how to add this action to your flow and configure the parameters.
Create a standard Salesforce flow. You can choose to have any type of trigger conditions here. Then add an element and choose actions. If you have CloudFiles correctly installed and connected, you can find the Create Folder action in the CloudFiles category.
NOTE: If you use a record triggered flow, make sure you run this action on an asynchronous path as shown below.
Library is the desired Cloud based drive where you wish to create the folder. This is a simple text field and you can enter one of these options -
- sharepoint for SharePoint
- google for Google Drive
- onedrive for OneDrive Personal & OneDrive for business
- dropbox for Dropbox
- box for Box
- cloudfiles for AWS s3
These parameters help specify where the target folder should be created. There are multiple parameters that may need to be set based on the target cloud storage. E.g. sharepoint users require all 3 while dropbox users may require only one.
These parameters can be easily copied from within Salesforce using the Content Library Tab. Below we describe these parameters and then we show how to copy them easily with a single click.
- Parent Folder ID -This is the cloud drive generated ID of the folder where you want to create this folder in.
- Drive ID -This is important for google drive & sharepoint users only. These cloud storages offer multiple 'drives' where documents can be uploaded.
These parameters can be obtained within Salesforce with a single click by navigating to the parent folder in the Content Library Tab and clicking the "View Metadata" button as shown in image below. The Content Library Tab can be accessed from the CloudFiles App Launcher or an also be inserted onto any of your standard or custom apps.
Follow the steps below to retrieve these IDs -
- Click on App Launcher on top left. Search for the CloudFiles App.
- In the CloudFiles App, select the Content Library Tab
- Go to your cloud storage. You may need to login if you haven't done so before.
- Go to the target folder where you would like to place the created folders in.
- A dialog box opens up which shows all the IDs. Copy the ID from here.
These steps are shown in the GIF below -
Folder name is the name you wish to give your created Folder. You can add merge fields from the respective Salesforce object as well. E.g. in our example, we used the lead's first name as the name of our created folder.
A standard strategy is to create a calculated field on your object from multiple text properties that acts as the name of the folder, and then use this calculated field here.
The Apex action returns the following deatils of the created folder. You can choose to save them somewhere if you wish to use it later.
- Drive ID
- Resource ID
- Resource Name
- Resource Path
In the gif below, we show how creating a new lead creates a new folder in Sharepoint.