Introduction
The CloudFiles: Delete Resource flow action allows you to delete a resource (file or folder) in a connected external storage, such as SharePoint, Google Drive, Dropbox, Box, or AWS S3. For SharePoint, it can also delete a whole drive (document library) or an entire site. 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.

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:
- 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.
- 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
- Description: The external storage service where the Resource/s is located.
- 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 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.
- Deleting a drive or a site: when Resource Type is drive, enter the ID of the drive you are deleting — the same value you put in Resource ID. When Resource Type is site, leave Drive ID blank. See Deleting SharePoint drives and sites.
Resource ID
- Description: The unique ID of the resource (file or folder) to be deleted.
- How to Get It:
- Use the output of 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.
- Alternatively, use record fields where Resource IDs are stored.
- For a drive or a site: enter the drive ID or the site ID. Use the output of Create SharePoint Drive or Create SharePoint Site, or a record field where the ID is stored.
Resource IDs
- Description: The unique ID of the resource (file or folder) to be deleted.
- How to Get It:
- 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 Resource IDs of folder contents {!Outputs from Get Folder Contents} > Resource ID.
- Or use record fields which have Resource Id stored in them.
Resource Type
(Not needed for Multiple Resource Deletion)
- Description: Indicates what kind of resource is being deleted.
- Valid Values: file, folder, drive or site. drive and site apply to SharePoint only.
Deleting SharePoint drives and sites
On SharePoint, the Delete Resource action deletes drives (document libraries) and sites as well as files and folders. It is the same action — set Library to sharepoint, and change Resource Type and the IDs you pass.
| Resource Type | Drive ID | Resource ID |
|---|---|---|
| file or folder | The ID of the drive the file or folder lives in | The ID of the file or folder |
| drive | The ID of the drive being deleted | The same drive ID |
| site | Leave blank | The ID of the site being deleted |
Deleting a drive deletes every file and folder in that document library. Deleting a site deletes the site and all of the drives it contains, including any folders CloudFiles has connected to Salesforce records — those attachments will point at resources that no longer exist. This cannot be undone from Salesforce. Test the flow against a spare site before you activate it.
Where to get the IDs: the Create SharePoint Site action returns Site ID and Primary Drive ID, and Create SharePoint Drive returns Drive ID. Store them on the record at creation time so the flow that deletes them later has the IDs to hand. Drive IDs are also on the Content Library Tab in Salesforce, under the "View Metadata" button.
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. For a drive or a site, confirm in the SharePoint admin center that the document library or site no longer appears.