Flow Actions

Delete Resource

Introduction

The CloudFiles: Delete Resource flow action allows you to delete a resource (file or folder) in connected external storage, such as SharePoint, Google Drive, Dropbox, Box, or AWS S3. This action can handle the deletion of a single resource or multiple resources in one execution, providing flexibility for various use cases.

The image below demonstrates how the Delete Resource action looks. Detailed explanations of input parameters and usage are provided in the following sections.

Document image


What this action does

The Delete Resource action simplifies the management of external storage by enabling users to automate the deletion of unnecessary or outdated files and folders directly from Salesforce.

Imagine a workflow where Account Folders are automatically deleted from external storage if the associated Salesforce Account record is archived. Using the Delete Resource action, you can:

  1. Trigger a flow on Account Record Deletion to delete the associated Account Folder using the Folder ID stored in one of the Account record fields.
  2. Use a custom object that stores metadata details for folders linked to deleted records. A Scheduled Trigger Flow can then process these records and delete the resources accordingly.

This action ensures that your external storage remains organized and clutter-free without requiring manual intervention.

Input Parameters

To use the CloudFiles: Delete Resource action in Flow Builder, configure the following input parameters:

Library

  1. Description: The external storage service where the Resource/s is located.
  2. Valid Values: sharepoint, google, onedrive, dropbox, box, or cloudfiles (AWS S3).

Drive ID

  • Description: The drive ID for Google Drive or SharePoint where the Resource/s to be deleted resides.
  • Required For: Google Drive, SharePoint.
  • How to Get It:
    • Use the output of a previous flow actions like Get Connected Folder to retrieve the Drive ID.
    • OR Retrieve this from the Content Library Tab in Salesforce using the "View Metadata" button.

Resource ID

  1. Description: The unique ID of the resource (file or folder) to be deleted.
  2. How to Get It:
    1. Use the output of a previous flow actions like Get Connected Folder or Get Resource Details to retrieve the resource ID. For example, {!Outputs from Get Connected Account Folder} > Resource ID.
    2. Alternatively, use record fields where Resource IDs are stored.

Resource IDs

  1. Description: The unique ID of the resource (file or folder) to be deleted.
  2. How to Get It:
    1. Configure a Text Collection by utilising outputs from flow actions like Get Folder Contents or Get Resource Details to retrieve the resource IDs. For example, create a Text Collection by retrieving the ResourceIDs of a folder contents {!Outputs from Get Folder Contents} > Resource ID.
    2. OR Use record fields which have ResourceId stored in them.

Resource Type

(Not needed for Multiple Resource Deletion)

  • Description: Indicates whether the resource is a file or a folder.
  • Valid Values: file or folder

Output Parameters

The Delete Resource action does not return explicit output parameters. However, once executed, the specified resources will be permanently deleted from the external storage. You can verify the deletion by checking the external storage to confirm the resource is no longer present.