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 manually attach a file/folder to the record using the cloudfiles widget, or 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? docid 9ibd0tgbyrtn kgjpxhtn 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 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 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 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 docid\ lhksgxm3wipb9fyipisvj 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 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 action status this is a success or failure message based on whether the action was executed correctly