Flow Actions
Doc Management Flow Actions

Create Attachment

introduction the cloudfiles create attachment flow action allows you to link a file or folder from an external cloud storage service (e g , google drive, sharepoint, dropbox) to a salesforce record once linked, these files or folders appear in the cloudfiles widget on the salesforce record's page, providing seamless integration between salesforce and cloud storage the image below illustrates a sample flow using the create attachment action to link a resource (file or folder) to a salesforce record detailed explanations of input parameters and usage are provided in the following sections what this action does the create attachment action simplifies the process of linking external storage resources with salesforce records, ensuring quick access through the cloudfiles widget imagine you want to set up an automation that creates a folder in external storage for every new salesforce account record to make this folder accessible from the account record page, you can use the create folder docid\ xrardogtcdiogtagjunnl action to create the folder in external storage use the create attachment action to link the newly created folder to the salesforce account record this ensures the folder is automatically connected and accessible in the cloudfiles widget on the account record page, eliminating the need to manually connect a folder to the record below is an example of an attached folder input parameters when adding the cloudfiles create attachment action in flow builder, configure the following input parameters resource id description the unique id of the resource (file or folder) to be attached how to get it use the output of a previous flow action like create folder docid\ xrardogtcdiogtagjunnl or get resource details docid\ ue5s2y9qglsceiqd0serc to retrieve the resource id for example, {!outputs from create folder} > resource id resource type description indicates whether the resource is a file or a folder valid values file or folder library description the external storage service where the resource is located valid values sharepoint , google , azure , onedrive , dropbox , box , or cloudfiles (aws s3) drive id description the drive id for google drive or sharepoint where the resource resides required for google drive, sharepoint how to get it use the output of a previous flow action like create folder docid\ xrardogtcdiogtagjunnl or get resource details docid\ ue5s2y9qglsceiqd0serc to retrieve the drive id or retrieve this from the content library tab in salesforce using the "view metadata" button salesforce record id description the id of the salesforce record to which the resource will be attached example use {!$record id} in a record triggered flow or specify a dynamic value, such as {!triggering account} > account id how to get metadata details ? some of these parameters like driveid 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 in a dialog box opens up which shows all the ids copy the id from here these steps are shown in the gif below output parameters the apex action generates a custom type called attachment as its output while it does not explicitly list output parameters, you can retrieve the following information for use in subsequent steps attachment id the cloudfiles unique id of the created attachment resource docid\ mr7u7qdhigoasucpf nlr properties resource id external id of the resource name name of the attached resource path the path of the resource in external storage type type of the resource ("file" or "folder") library external storage service used drive id relevant for google drive or sharepoint these values can be used for further operations or stored for reference the image below shows the output of the create attachment apex action see it in action in the gif below, we have shown how we create the attachment and attach the created folder to the salesforce account record