Tutorials
Document Management Tutorials
Setting Up a Custom List Action in the CloudFiles Widget
custom list actions in the cloudfiles widget let you create clickable action buttons that appear when a user selects one or more files or folders within the widget on a salesforce record page these buttons are linked directly to salesforce flows, allowing you to trigger powerful, customized automation —without leaving the record view in this tutorial, we’ll walk through creating one such action called “bulk delete” you’ll set it up so that when users select multiple files or folders in the cloudfiles widget and click the bulk delete button, those items will be permanently removed from your connected external storage (e g , sharepoint, google drive) and disappear from the salesforce record page widget by the end of this guide, you’ll have a working custom list action that you can configure yourself—ready to streamline file management, reduce clutter, and give your users a one click way to keep salesforce clean and organized what to expect by the end of this tutorial, you will be able to automatically generate a main folder with custom sub folders in your external storage whenever a new account is created in salesforce, and access these folders through the cloudfiles widget on the corresponding record create and configure a custom list action (e g , bulk delete ) that appears in the cloudfiles widget when users select one or more files or folders on a salesforce record page use this button to permanently delete selected files or folders from your connected external storage (e g , sharepoint, google drive), directly from salesforce the gif below illustrates the expected outcome once everything is set up pre requisites before you start with the set up, please ensure these steps are completed install cloudfiles in salesforce cloudfiles is available on the salesforce appexchange and can be installed using the standard app installation process check out installation guide docid\ fv1sn qekhvsae njyp6y to know more connect your cloud storage to salesforce using cloudfiles all automations in cloudfiles are activated through salesforce flow builder, utilizing account wide authentication for external storage libraries through a service (admin) user to connect your service user, access the setup, click on the external storage of choice and log into your account for detailed steps, follow automations docid 4nyi6hnqnavp4dbjah tz or refer to the gif below for a clearer understanding add cloudfiles widget to account record page add the cloudfiles widget to account record page in order to view the files and folders within salesforce follow the steps below go to any account record and click “edit page” button lightning builder for this page will open insert a new tab and drag and drop the "cloudfiles" widget save and exit the builder refresh the salesforce record page the widget should now show up refer to the gif below to get a visual understanding of this step the inserted widget may show a blank screen but you don't need to worry about it move on to the next step automatic folder creation for accounts for this tutorial, we require automated folders to be created upon the creation of new account to accomplish this, we will create two distinct record triggered flows using cloudfiles actions for a comprehensive guide on the process of creating automated folders, please refer to our tutorial at create automated folder hierarchies for managing external files from salesforce objects docid\ ynzb pjpdnjkkttmq1p t this is how the flow would look like configure the cloudfiles widget to add a custom list action button and link it to the flow in this section, we’ll walk through how to configure the internal record widget guide docid\ rcwdmuwywxjr628vd20vr to add a custom widget flow actions in cloudfiles docid\ dk 1jq9encvg5qzcunybw button and link it to the flow we are going to create in the next steps you’ll learn how to set up the list action within the widget configuration link the action to your screen flow with the appropriate input variables once the configuration is complete, copy the generated widget configuration id and paste it into the cloudfiles widget settings on the account record page in salesforce this step ensures that the correct resource action button appears in the widget, allowing users to trigger the delete functionality setting up widget flow actions in cloudfiles widget follow these steps to configure resource actions in the cloudfiles widget step 1 open widget configuration navigate to the cloudfiles document management app open the "widget configuration" page step 2 locate list actions section scroll to the bottom of the page, where you'll find the list actions section refer to the image below for a visual understanding step 3 specify attributes for actions for each list action, provide the following details label – this is the name that will appear on the widget button (e g , bulk delete ) flow url – the url of the flow you want to trigger, including input variables flow type – choose the type of flow from the dropdown for this tutorial, select screen flow in this example {!resources } refers to the files or folders selected by the user in the cloudfiles widget at the time of clicking the defined custom list action button {!recordid} is the salesforce record (account) from which the action is being triggered step 4 save and link the widget after entering all configuration values, click save copy the generated widget configuration id navigate to the account record page in salesforce and paste this id into the cloudfiles widget configuration panel this step enables the list action button to appear within the widget, allowing users to permanently delete the selected file or folder with just a click flow – delete unwanted resources using the cloudfiles custom list action in this section, we’ll create a custom list action – driven screen flow to permanently delete selected files or folders from your connected external storage when triggered by the user this is especially useful for cleanup operations—for example, removing outdated files from an account after a project is completed we’ll configure a screen flow that launches when the user clicks the custom list action button after selecting one or more files or folders in the cloudfiles widget the flow will permanently remove the selected resources from your connected external storage (e g , sharepoint, google drive) immediately update the cloudfiles widget so the deleted files or folders no longer appear on the salesforce record page ensure secure deletion while keeping your file structure clutter free once the flow is activated, you can proceed to configure the widget and link the custom list action this will allow users to access the bulk delete function directly from the cloudfiles widget on the salesforce record page by using this button, users can delete unwanted files or folders in bulk with confirmation, simplifying file management and ensuring that only relevant, up to date resources remain accessible this is how the final flow looks like the details of the flow has been given below 1 configure a screen flow we’ll begin by creating a screen flow to handle the logic for bulk deleting files or folders from your connected external storage follow the steps below to set up the required input parameters create a new screen flow in salesforce to manage the bulk deletion process add an input variable called recordid to capture the salesforce record id (e g , account ) from which the action is being triggered via the cloudfiles widget create another input variable called resources variable to get the selected resource from the cloudfiles widget create flow variables to pass selected resource (file/folder) and the current record id to the flow, create the following two variables resources type variable data type apex defined apex class clds resource allow multiple values (collection) true available for input true recordid type variable data type text allow multiple values (collection) false available for input true the gif below provides a visual understanding of this step 2 get connected folder we will use get connected folder docid iq8rljf2ne8sx0 iuu apex action to retrieve the details of the folder connected to the current account record once you add the action to your flow, it will prompt you to provide a single input parameter parentid – this is the salesforce record id whose connected folder needs to be fetched in this case, use the {!recordid} variable (which we configured as available for input ) to pass the current account's record id into the action we’ll use the folder information retrieved here in the next step to locate and delete the selected file(s) or folder(s) from the appropriate location in your external storage refer to the gif below to get a visual understanding of this step 3 – collect the selected resource id's to delete in this step, the resources variable will already contain details of all the files or folders the user has selected in the cloudfiles widget to prepare them for deletion, go through each item in this list and pick out just the id for that file or folder as you do this, add each id to another variable, for example resourceids you can gather these ids using an assignment step called populate resourceids variable , so by the end you have a single list containing only the ids of the selected items, ready for the deletion step 4 – delete the selected resources in this step, we’ll configure the delete resource docid\ pj4e0fttru7v yidtswdn apex action to remove the selected resources (files & folders) from your connected external storage by passing the required input values delete resource – apex action configuration library this is the target cloud storage provider where the resource should be deleted possible values are sharepoint, google (for google drive), onedrive, dropbox, box, cloudfiles (aws s3) in our case, we can dynamically input this value from the get connected folder action itself using {!get connected folder library} drive id this is required for google drive and sharepoint libraries enter the drive id where the selected resources are stored in this tutorial, since we already have access to the get connected folder action, we can directly use the drive id from it {!get connected folder driveid} resource id we can skip this field because either resource id or resource ids is required—not both in our case, we are deleting a list of resources, so we’ll toggle off resource id and use resource ids instead resource ids in this field, enter the list of ids for the files or folders you want to delete from your external storage since we have already collected the selected resource ids into a list variable named resourceids in the earlier step, simply pass that variable here this will ensure that all the selected items are deleted in one go when the flow runs resource type in our case, this parameter is not required because we are performing a bulk deletion of resources that may include both files and folders in a single operation for bulk deletion, this field is optional, so you can simply toggle it off once all these fields are filled in correctly, the action will delete the selected items both from the external storage and from the cloudfiles widget on the salesforce record page 5 save and activate the flow once you’ve finished configuring all elements, save your flow and then activate it after activation, the flow can be triggered directly from the custom list action button in the cloudfiles widget this button was configured earlier in the cloudfiles widget configuration, and its configuration id was added to the record page in edit mode when users select one or more files or folders and click this button, the flow will run and permanently delete the selected resources from your connected external storage the same resources will also be removed from the cloudfiles widget on the salesforce record page test it in action to verify that everything is working as expected, follow these steps create a new account once the account is created, the folder structure will be automatically generated by the pre configured flow responsible for account folder creation upload files to the account folder using the cloudfiles widget on the account record page, upload some test files and folders into the newly created account folder select and delete unwanted files or folders when you no longer need certain files or folders, select them in the cloudfiles widget and click the custom list action button ( bulk delete ) you configured earlier verify deletion in the widget after triggering the action, the deleted resources will no longer appear in the cloudfiles widget on the account record page—confirming that the deletion was successful confirm deletion in external storage open your connected external storage (e g , sharepoint, google drive) and navigate to the same location where the files were stored the deleted files or folders should no longer be present flow execution and folder creation may take some time (a few seconds to a minute) if you don't see any changes, try refreshing the cloudfiles widget a couple of times congratulations! you’ve successfully set up a custom list action button in the cloudfiles widget, allowing users to easily bulk delete unwanted account files or folders directly from salesforce you’ve also configured the supporting screen flow to handle the deletion process—removing selected items from both your connected external storage and the cloudfiles widget—helping keep your salesforce records clean, organized, and up to date this setup streamlines file management, reduces clutter, and ensures that only relevant, current files remain visible to your team—improving efficiency and maintaining a well structured workspace