Create Attachment Action
The create attachment action is used to associate files, folders or datarooms to HubSpot records. An attachment is a tile that appears on the CloudFiles widget in the sidebar on any HubSpot record which enables easy access to associated resources. Files & folders can even be attached automatically from cloud storages such as SharePoint, Dropbox, Google Drive etc...
Make sure that you have connected an automation user in order for this action to work with your Cloud Storage.
The Create attachment action requires the following parameters in order to create the attachment -
- Library- This specifies the target cloud storage library such as Google Drive, SharePoint, OneDrive etc...
- Library Dependent parameters- The parameters after library change based on the library selection. These parameters help specify the target file, folder or dataroom that must be attached to the record
In the sections below, we detail each of the parameters that can appear in this action.
1 - Library
Library is the desired Cloud storage from where you want to create a file, folder or dataroom attachment. For files and folders, anything between CloudFiles, OneDrive, SharePoint, Box or Dropbox can be selected. For dataroom attachments, you must select CloudFiles as the library.
Based on your choice, new parameters would become visible in the action. These are discussed in the sections below.
2 - Resource Type
This parameter becomes visible when CloudFiles library is chosen. This is important for users who want to attach a dataroom to the record. The selector shows the type of resources that can be attached. Selecting dataroom in this selector helps the app identify that a dataroom needs to be attached.
3 - Resource ID
This parameter becomes visible when CloudFiles library is chosen. This is important for users who want to attach a dataroom to the record. If you have created a dataroom in this workflow using the Create Dataroom action, you can simply use the return value of that action in this parameter. This is shown below -
If instead you have an existing dataroom that you want to attach to all records, grab the dataroom ID from the CloudFiles dashboard and use it in the parameter. You can grab an existing dataroom ID using the steps below -
- Find the CloudFiles widget from any HubSpot record, and click on CloudFiles. It will redirect you to app.cloudfiles.io
- Go to the Datarooms tab.
- Either create a new dataroom here or click on the dataroom which is to be cloned.
- In the address bar of your browser, you will find the dataroom ID. It should look something like this:
This is shown in the GIF below -
4 - Shared Drive ID / Drive
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 pick the file or folder from.
In order to retrieve this Drive ID, follow the simple steps below -
- Find the CloudFiles widget from any HubSpot record, and click on CloudFiles. It will redirect you to
- Under the libraries tab, navigate to the file or folder that you are trying to attach.
- Copy the parameter from the meta data on the right side of the screen.
These steps are shown in the GIF below -
5 - Path to file or folder
This field is available for all library selections. If you are trying to attach a file or a folder, this is the field where you specify the path to that file or folder. Note that exact and full path must be provided here in order to attach the file / folder correctly.
The path to the file or folder can be simply copied from the meta data info in the CloudFiles Library using the same steps as specified in the shared drive ID section above.
6 - Root Folder ID (Optional)
This is an optional parameter that can be used for optimization if you have very deep folder hierarchy. Instead of having the action search through the entire hierarchy every time which may cause slowness, you can specify a hard coded folder ID here. Along with this, you must also update the path you specified above such that the CloudFiles app will start the search for the file or folder from the root folder ID rather than the root of the cloud storage.
The folder ID of any folder can be retrieved from the meta data info in the CloudFiles Library using the same steps as specified in the shared drive ID section above.
Use this parameter only when you are absolutely sure you know how to use it, otherwise keep it blank.
Keep this parameter empty if you are already using the full path to the folder in the previous paramter. This parameter is only meant to be an optimization in case you have a deep folder hierarchy and want to set a non-root folder as the base for searching for the path in the previous parameter.
7 - Return Values
The Create Attachment action returns the following values. These can be used in later actions to chain together actions and create complex automations.
- Action Status- This is a success or failure message based on whether the action executed correctly.
- New Attachment ID- The ID of the newly created attachment. This can be used as the attachment ID in other actions such as share attachment
Need help? Book time with our team of experts.