Flow Actions
Doc Management Flow Actions
Get Folder Contents
introduction the get folder contents flow action outputs all the files and folders within a queried external storage folder as a collection of resources the output collection can then be used in flow elements further the image below gives an overview of the input parameters detailed description of these parameters are provided in the following section get folder contents flow action jpg what this action does the get folder contents flow action can be combined with various other flow actions or elements to automate processes for example, you can perform a simple null check on the output collection to determine if the queried folder is empty, or apply more complex logic, such as looping through the collection to segregate files based on naming conventions the flow snippet below demonstrates a use case where the get folder contents action retrieves the contents of a template folder with a predefined sub folder structure the output collection is then looped over to replicate this structure into another folder, creating each sub folder one by one with the same name as the current folder in the loop input parameters this action requires the metadata of the target folder to retrieve its contents the image below shows the mandatory fields populated for reference screenshot 2024 09 06 at 1 34 21 pm png each parameter is explained in detail below library the library parameter is the external storage type you are using possible values are sharepoint , google , azure , onedrive , dropbox , box , or cloudfiles (aws s3) this is a mandatory input parameter drive id this is important for google drive & sharepoint libraries only the drive id is a unique identifier for a storage location in both sharepoint and google drive in sharepoint, it represents a document library within a site, while in google drive, it identifies a user's drive or shared drive this is a mandatory input parameter resource id this is the folder id of the target folder whose contents are to be retrieved this is a mandatory input parameter you can get these three parameters by viewing metadata details for a folder in the “content library” tab of cloudfiles app in salesforce or can be fetched through other flow actions like get connected folder resource path this parameter is not in use currently and can be toggled off resource name this parameter is not in use currently and can be toggled off type this parameter is not in use currently and and can be toggled off output parameters the action returns all the contents of the input folder as a collection of resources see it in action in the gif below, it is shown how the flow action retrieves the contents from a folder