Get Connected Folder
The "Get Connected Folder" flow action can retrieve folder-type attachments for a Salesforce record, for example the Account Parent folder details. If multiple folders are attached, it retrieves the first folder's details. To handle scenarios with multiple folders, we use a different approach. For more details, please refer Create Automated Folder Hierarchies for Managing External Files from Salesforce Objects
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 Get Connected Folder action requires the following parameters -
- Parent ID - This is the Id of the Salesforce record for which you want to retrieve the attachment.
This action gives various parameters of the newly obtained resource’s destination parameters -
- Resource ID - Folder ID of the newly retrieved resource
- Resource Name - Name of the newly retrieved resource
- Other parameters - Parameters specifying the location of created resource
In this article we will first dive into the details of the input & output parameters and then will discuss how this action can be used in different scenarios.
This action retrieves the details of a folder attached to a Salesforce record. If multiple folders are attached, only the first attached folder will be considered.
This flow action takes only 1 parameter, which is "Parent Id".
The Parent ID is the ID of the Salesforce record for which you want to retrieve the attachment. This can be obtained from the flow's "Record" variable in record-triggered flows or from the flow's “Triggering_cldfs_CloudFiles_Event_e” record in platform event-triggered flows.
In the Parent ID field, select 'SalesforceFiles' > 'ParentId'.
For example, in the Parent ID field, select 'Outputs from CloudFiles: Get Event Details (Get Uploaded Files Details)' > 'Salesforce Files Details' > 'ParentId'. Refer to the image shown below.
The Apex action returns the following details of the connected 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.