Delete Attachment
The CloudFiles: Delete Attachment flow action is the reverse of the Create Attachment action. It allows you to disconnect an already linked resource (file or folder) from a Salesforce record. Once disconnected, the file or folder will no longer appear in the CloudFiles Widget on the Salesforce record's page.
The image below illustrates a sample flow using the Delete Attachment action to remove a linked resource from a Salesforce record. Detailed explanations of input parameters and usage are provided in the following sections.
The Delete Attachment action automates the process of unlinking or disconnecting external storage resources from Salesforce records, ensuring that only relevant files or folders remain associated with a record.
Scenario:
Imagine an automation where files or folders linked to an opportunity need to be removed after the opportunity is closed or lost. Using the Delete Attachment action, you can disconnect these resources, ensuring they no longer appear in the CloudFiles widget on the Opportunity record page.
When adding the CloudFiles: Delete Attachment action in Flow Builder, configure the following input parameters:
- Description: The external storage service where the resource is located.
- Valid Values: sharepoint, google, azure ,onedrive, dropbox, box, or cloudfiles (AWS S3).
- Description: The unique ID of the resource (file or folder) to be disconnected.
- How to Get It:
- 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.
- OR Use record fields which have ResourceId stored in them.
- Description: Indicates whether the resource is a file or a folder.
- Valid Values: file or folder
- Description: The ID of the Salesforce record from which the resource will be disconnected.
- Example: Use {!$Record.Id} in a record-triggered flow or specify a dynamic value such as {!Triggering Account} > Account ID.
The Delete Attachment action does not return any explicit output parameters. However, once executed successfully, the specified resource will be disconnected from the record.
You can verify this by:
- Checking the CloudFiles widget on the Salesforce record page.
- Ensuring the resource no longer appears in the widget.