Tutorials

Automate Deal Folder and Subfolder Creation with Selective Folder Sharing in HubSpot

18min

In this tutorial, we’ll walk you through the process of automatically creating folders and sub-folders in any external storage system, and how to directly share a link to any specific subfolder from a HubSpot record using the CloudFiles-HubSpot Integration. We’ll use CloudFiles flow actions to automate the creation of these folders and sharing links efficiently.

What to Expect

By the end of this tutorial, you can expect to:

  1. Set up an automated parent folder for a HubSpot record (e.g., deal) upon its creation.
  2. Automatically create the desired number of subfolders within the parent folder.
  3. Attach these folders and subfolders to your HubSpot record.
  4. Generate a shareable link for any specific subfolder.

The GIF below demonstrates the expected outcome. If you're familiar with these concepts, you should be able to complete the tutorial in under 10 minutes.

Document image
ο»Ώ

1 - Pre-requisites

Before you start with the set-up, please ensure you have installed CloudFiles and connected it to your cloud storage of choice.

Install CloudFiles in HubSpot

CloudFiles is available on the app marketplace and can be installed using the standard app installation process. Check out Installation guide for CloudFiles HubSpot Integration.

Document image
ο»Ώ

Connect your storage

Login to your external storage of choice such as Google Drive, SharePoint etc. through the CloudFiles interface. This will give you instant access to your external files within HubSpot. The GIF below shows the steps quickly. Check out Quick start for file connector in HubSpot for more information.

Document image
ο»Ώ

Connect Automation User for Storage

In addition to installing CloudFiles in HubSpot, you also need to set an automation user for the workflow to work. This is the integration user that will be used by the workflow actions to pass files into the cloud storage.

To connect an automation user, simply head over toΒ app.cloudfiles.ioΒ > Settings > Integrations > Google Drive and login through your google account. What is an 'Automation User' and how does it work? this article explains everything you need to know about the automation user, including what it is, why it's useful, and how it operates.

Document image
ο»Ώ

After connecting the desired storage, we will proceed to create deal-based workflow which will be triggered when a new deal is registered. Here’s how our final workflow looks like. We will detail these elements in the sections below.

Document image
ο»Ώ

ο»Ώ

2 - Create a Deal-based Workflow

Create a new deal-based workflow from scratch and select the trigger to fire when a new deal is created as shown in the GIF below.

Document image
ο»Ώ

3 - Create Parent Deal Folder using β€˜Create Folder’ Action

The "Create Folder" action allows you to create folders in any location on any cloud storage platform directly from a HubSpot workflow. We'll use this action to first create the Parent folder, within which sub-folders will be automatically created.

To use the "Create Folder" action, click the "Add" button and search for "Create Folder". Once added, you'll need to fill in a few required parameters.

Key Parameters:

  1. Library: This specifies the cloud storage where you want to create the folder. Select the desired storage from the drop-down field.
  2. Folder Name: Enter the name of the folder you want to create. You can use the Deal’s name or create a custom formula for the folder name.

The GIF below shows how to populate the Library and Folder Name parameters.

Document image
ο»Ώ

Additional Parameters:

  • Shared Drive ID: This is needed for Google Drive and SharePoint users only, as these platforms offer multiple "drives" where documents can be uploaded.
  • Path to Destination: This indicates the folder where the new folder will be created.

How to Copy the Parameters:

You can easily get the values for the "Shared Drive ID" and "Path to Destination" from the CloudFiles app library. Here’s how:

  1. Find the CloudFiles widget from any HubSpot record and click on CloudFiles. It will redirect you to your CloudFiles storage.
  2. Under the Libraries tab, navigate to the folder where you want to store your files or create a new one.
  3. Copy the parameter values from the metadata section on the right side of the screen.

Check the GIF below for a quick walkthrough of these steps.

Document image
ο»Ώ

For a detailed explanation of the "Create Folder" action, refer to the Create Folder detailed guide. Here's how our final "Create Folder" action looks:

Document image
ο»Ώ

4- Create Sub-Folders using β€˜Create Folderβ€˜ Action

To create sub-folders, we’ll use the same "Create Folder" action as before, with just a couple of simple adjustments.

  1. Change the "Folder Name" to the name of the sub-folder you want to create. For example, we’re creating "Shared Documents" and "Internal Documents" sub-folders inside our Deal folder.
  2. Update the "Path to Destination" with the exact, full path to the Parent folder created in the previous action.

Here’s how your second "Create Folder" action should look:

Document image
ο»Ώ

You can create as many sub-folders as needed by duplicating the "Create Folder" action. You can also create sub-sub-folders and even deeper hierarchies using this method.

5 - Show the sub-folders on Deal Record using β€˜Create Attachment’ Action

The "Create Attachment Actionο»Ώ" is used to link newly created Shared Documents and Internal Documents sub-folders to HubSpot records. Associating these sub-folders is crucial as it allows you to view and manage the sub-folder contents directly from the HubSpot record.

To use this action, click the "Add" button and search for "Create Attachment," as shown below. After adding this action, you’ll be prompted to fill in a few parameters. The "Shared Drive ID" and "Library" parameters will remain the same as mentioned previously.

The "Path to folder" should be the exact, full path of the subfolders you’ve created. You can easily copy this from the metadata in the CloudFiles Library, following the same steps as described in the Shared Drive ID section above.

Here’s how the final "Create Attachment" action should look:

Document image
ο»Ώ

6 - Create shareable link for the folder using β€˜Share Attachment’ action

The "Share Attachment Actionο»Ώ" allows you to share attachments through HubSpot workflows. This process is similar to manually creating a sharing link for a file, folder, or dataroom from a HubSpot record.

To use this action, click the "Add" button and search for β€œShare Attachment.” This action has a single parameter where you specify the attachment to be shared. You can get this attachment from the return value of the "Create Attachment" action of the Shared Documents folder - β€œNew Attachment ID.”

This is what the final Share Attachment action looks like -

Document image
ο»Ώ

7 - Set the sharing link of the sub-folder to deal property using β€˜Edit Record’ Action

In this step, we will link the URL created in the previous step to a deal property. To do this, first, create a new single-line text property in the HubSpot Deal Settings. We’ll name this property β€œShareable Link.”

Next, we will use the β€œEdit Record” action to set the shared link to this property. For the "Property to set" field, select β€œShareable Link.” Under the β€œShareable Link” field, set the value to the β€œURL” output from the previous action.

The GIF below demonstrates how to configure the Edit Record action.

Document image
ο»Ώ

8 - Test the Workflow

Now that everything is set up let's test our workflow. Start by creating a new deal in HubSpot. The workflow may take a few seconds to execute, so you might need to refresh the page if necessary.

Once the workflow completes:

  1. Go to the CloudFiles widget on the right-hand side. You should be able to see the sub-folders.
  2. Next, navigate to the properties section and look for the "Shareable Link."
  3. Copy the link and open it in a new window.

You can now share this link with your contacts, and they will be able to access the documents.

The GIF below demonstrates this process.

Document image
ο»Ώ

ο»Ώ