Create Folder
The Create Folder flow action allows you to automatically create folders, sub-folders, and any desired hierarchies in various cloud storages like Google Drive, SharePoint, OneDrive etc. The image below illustrates what this action looks like, including its various input and output parameters. Detailed descriptions of these parameters are provided in the following section.
The Create folder action requires the following parameters -
- Folder name - Final name of the folder that can be built using Salesforce merge fields
- Destination parameters - Various parameters that specify where the folder must be created
This action gives various parameters of the newly created folder as the output -
- Resource ID - Folder ID of the newly created folder
- Resource Name - Name of the newly created folder
- Other parameters - Parameters specifying the location of created resource
In this article we will dive into the details of the input & output parameters.
The Create Folder action simplifies and automates the organization of your files by allowing you to specify the destination and structure you need. For example, You can use this action with an account object to automatically create an account folder in Google Drive whenever a new account is created. The image below illustrates how this automation would look -
Here is a list of all input parameters with a summary. For details, check out the individual sections below -
- Folder name - Final name of the folder that can be built using Salesforce merge fields
- Destination params - Various parameters that specify where the folder must be created
- Library - Library is the desired Cloud based drive where you wish to create the folder.
- Drive ID - This is important for google drive & sharepoint users only. These cloud storages offer multiple 'drives' where documents can be uploaded.
- Parent Folder ID - This is the cloud drive generated ID of the folder where you want to create this folder in.
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.
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 such as library, drive ID, parent folder ID etc... 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.
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, google, onedrive, dropbox, box, cloudfiles (for AWS S3).
It's best to copy this parameter from the dialog box as shown below.
This is the cloud drive generated ID of the folder where you want to create this folder in. This can be grabbed from the metadata dialog as shown below.
This is important for google drive & sharepoint users only. These cloud storages offer multiple 'drives' where documents can be uploaded. Drive ID can be copied form the metadata dialog as shown below.
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 -
The Apex action returns the following details of the created folder. You can choose to save them somewhere if you wish to use it later.
This is the ID of the newly created folder. This is used as parent folder ID for subsequent sub folders. This ID is crucial for specifying the exact location within the storage service hierarchy where the folder should be placed.
This is the Drive ID of the drive where the folder got created. This Id remains constant for sub folders. It specifies the exact location within the storage service where the folder should be placed.
This is the Cloud Storage in which the folder got created. One can use any external storage for example google , sharepoint etc.
This is the name of the newly created folder. Used to identify the folder within storage service.
This is the Cloud storage path of the newly created folder. It specifies the particular endpoint and resource you want to interact with, such as records, objects, or custom resources.
This is the Type of the resource. It will always be 'folder'. Used for classifying the resource type in create attachment.
In the gif below, we have shown how creating a new lead creates a new folder in Sharepoint.