Delete Resource Action
The "Delete Resource" action in CloudFiles allows you to remove files or folders from your cloud storage. For example, if a customer is no longer with your company and you want to delete their folder, you would use the "Delete Resource" action to do this.
To make sure this action works with your Cloud Storage, you need to understand What is an 'Automation User' and how does it work?
The "Delete Resource" action takes in various parameters to specify the source & destination of the file.
- Library: The desired library where the file must be moved (e.g. SharePoint, Google Drive etc...)
- Path to Resource: The exact path to the file or the folder. There may be more than one parameters required to specify this path based on library selection.
- Return Values: Various values returned by this action after execution.
These parameters have been detailed in the section below:
The cloud storage from where the file is to be deleted from. Anything between CloudFiles, OneDrive, SharePoint, Box or Dropbox can be selected. Based on your choice, new parameters would become visible in the action. These are discussed in the sections below.
This specifies the source from where the files must be deleted. You can specify the full path using a simple '/' separated string with the file name at the end.
The path to the folder can be copied from the metadata on the CloudFiles dashboard and then personalized using the record tokens. Follow the simple steps below -
1. Find the CloudFiles widget from any HubSpot record, and click on CloudFiles. It will redirect you to app.cloudfiles.io
2. Under the libraries tab, navigate to the file or folder that you are trying to add.
3. Copy the parameter from the meta data on the right side of the screen.
These meta deta example is shown below -
This is important for Google Drive & SharePoint library selection. Both these cloud storage have multiple drives where files can be stored. E.g. Google Drive has My Drive & Shared Drive while SharePoint can have multiple drives inside multiple sites. This parameter helps CloudFiles identify which drive to delete the file.
The drive ID can be copied using the meta data in CloudFiles dashboard as shown in the steps in the Path to resource section above.
The Move Resource action returns the following values. These can be used in later actions to chain together actions and create complex automations.
1. Action Status - This is a success or failure message based on whether the action executed correctly.