Workflow Actions

Delete Attachment

6min

Introduction

The "Delete Attachment" action in CloudFiles allows you to automatically remove file/folder attachments from HubSpot records using workflows. This is helpful when there are too many files or folders attached in the CloudFiles widget, or when certain attachments are no longer needed.

To use this action, make sure there is already an attachment linked to the record. You can do this in two ways:

  1. Manually attach a file/folder to the record using the CloudFiles widget, or
  2. Automatically create an attachment through a workflow if the file/folder/dataroom already exists.

Once the attachment is in place, you can set up a workflow to trigger the Delete Attachment action based on your preferred conditions. For example, you might want to remove the attachment once a deal is closed, or if incorrect files were uploaded.

To make sure this action works with your Cloud Storage, you need to understand What is an 'Automation User' and how does it work?

Document image


The "Delete Attachment" action in CloudFiles uses one parameter to identify the attachment to be deleted and provides a return value after the action is executed.

  1. Attachments to Delete – This parameter accepts a single attachment ID or a list of attachment IDs that need to be deleted from the record. In the section below, we will discuss this attachment ID in detail and explore ways to get this.
  2. Return Value – After the action runs, it returns the status of the deletion process, confirming whether the attachment was successfully deleted or if any errors occurred.
Document image


1  - Attachments to Delete

The "Delete Attachment" action can only remove an attachment if it has the attachment details. To get these details, the action must be preceded by either the "Create Attachment" action or the "Get Attachment Details" action. Both these actions provide the Attachment ID in their return values, which can be used as input for the Delete Attachment action.

If the attachment is being automatically created within the same workflow, the return value from the Create Attachment action can be directly used. However, if the attachment was created earlier, either manually or through another workflow, the Get Attachment Details Action should be used to fetch the Attachment ID.

The screenshot below shows how both actions return the Attachment ID, which can then be passed to the Delete Attachment action to specify the file or folder that needs to be deleted.

Document image


2 - Return Values

The Delete Attachment action returns the following values. These can be used in later actions to chain together actions and create complex automation.

  1. Action Status- This is a success or failure message based on whether the action was executed correctly.



Document image