Flow Actions
Doc Management Flow Actions

Copy Resources

introduction the cloudfiles copy resources flow action allows you to copy resources (files or folders) from one location to another within the same connected external storage this action is useful for automations requiring resource duplication or re organization, such as creating backup folders, replicating templates, or moving resources to a different location for specific workflows the image below demonstrates how the cloudfiles copy resources flow action looks detailed explanations of input parameters and usage are provided in the following sections what this action does the copy resources action performs the following tasks duplicates resources it copies files or folders from the source location to the specified destination folder publishes events instead of returning outputs immediately, the action publishes a resource cloned docid\ n3c5zlgpp3tvhy2kes041 event for each resource copied, enabling downstream automations scenario automate the creation of account folders with predefined subfolder structures use the create folder action to create an account folder retrieve the contents of the template folder using the get folder contents action loop through the retrieved folder contents and create a text collection of resource ids pass this collection to the copy resources action to replicate the subfolder structure in the account folder the image below provides an overview of such an automation input parmaters the following input parameters are required to configure the copy resources action destination drive id description the drive id of the destination where the resources will be copied details required for storages with multiple drives (e g , google drive, sharepoint) destination folder id description the id of the folder in the destination location where the resources will be placed drive id description the drive id of the resources being copied details indicates the current location of the resources to be copied how to get these parameters or metadata details ? some of these parameters like drive id can be obtained from within salesforce cloudfiles app by navigating to the parent folder in the content library tab and clicking the "view metadata" button as shown in image below 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 already go to the target folder where you would like to place the created folders a dialog box opens up which shows all the ids copy the id from here these steps are shown in the gif below file/folder ids description a text collection containing the resource ids of the files or folders to be copied details use a text collection to store multiple resource ids for a single resource, convert it to a collection using an assignment element configure file/folder ids parameter the parameter " file/folder ids " is a list parameter, which would only accept value of type list if you're copying a single file/folder, you can convert it to a list using an assignment element to do this insert an "assignment" element in the flow before the "copy resource" action in the variable field, click "new resource" set up a new resource as shown below please select the data type as "text" and check the box "allow multiple values(collection)" 4 click 'done', and then configure the assignment element as shown below please note the operator to be used is "add" and the value is the id of single file/folder library description the external storage system where the copy operation will take place (e g , sharepoint, google drive, dropbox) options possible values are sharepoint , google (for google drive), onedrive , dropbox , box , azure , cloudfiles (for aws s3) library specific limitations azure the action is not supported google the action is supported to copy folder type resources record id description the record id parameter is used to identify and manage the origin of the created resource cloned docid\ n3c5zlgpp3tvhy2kes041 event purpose event identification helps distinguish the source of the event in scenarios where multiple flows use the same action for different objects or use cases further automations enables performing further automations from the triggering event and event deatils key features flexible input you can input any text string, not just a record id event output whatever you input here will be available in the corresponding resource cloned docid\ n3c5zlgpp3tvhy2kes041 event details as record id how it works input the record id of the relevant record into this parameter when the event is triggered, the record id is included in the event details in the platform event mode flow setup docid\ hbil pqlgbixyg81yse9g event triggered flow, retrieve the record id from the event details to filter and process further automations, such as linking the resource to the record this parameter ensures traceability and flexibility in handling files across different flows and use cases you can use the record id not just to input a record id but literally any text string whatever, you input into the action shall be the output in the corresponding resource cloned docid\ n3c5zlgpp3tvhy2kes041 event if you need to differentiate the event based on the type of the object and also in between two separate scenarios scenario 1 input "scenario1identifierterm recordid" as the parameter scenario 2 input "scenario2identifierterm recordid" as the parameter in the event triggered flow fetch the parameter value from the event details use it to identify the record id and differentiate between the two scenarios this approach allows you to retrieve the record id for further automation differentiate between events to handle specific actions based on the scenario output parameters the cloudfiles copy resources apex action does not return anything as an output in the flow it is used but for every successful resource cloned a resource cloned docid\ n3c5zlgpp3tvhy2kes041 is published for example, if the action was configured to copy 4 resources, an event is published for each 4 successful copies this event signals completion of resource cloning and can be used to trigger platform event flows to perform post creation actions if the action fails due to some reason, an error event event will be triggered and this event can be used in decision element to diagnose and handle the error