Tutorials
Mirror Deal Folder to Contacts Automatically with CloudFiles
15 min
in this tutorial, we'll guide you through creating automated folders when a deal is created and ensuring that the same parent deal folder is automatically associated to the associated contacts of the deal using the cloudfiles hubspot integration we'll use cloudfiles flow actions to set up these automated folders what to expect by the end of this tutorial, you can expect to have an automated parent folder for a hubspot deal record when it is created you will be able to attach this parent deal folder to its associated contacts you will also be able to access these folders within your hubspot record within the cloudfiles connected folder widget the gif below shows the expected output if you have a basic grasp of these concepts, you can expect to finish the tutorial in under 10 minutes 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 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 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 http //app cloudfiles io/ > settings > integrations > google drive and login through your google account what is an 'automation user' and how does it work? https //help cloudfiles io/webapp/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 after connecting the desired storage, weโll proceed to create a deal based workflow that is triggered when a new deal is created next, weโll set up a contact based workflow to link the deal folder to its associated contacts below is an overview of the workflows, which weโll break down in the sections that follow section 1 create a folder for the deal and link it in this section, weโll make a workflow that automatically creates a folder when a new deal is added and attaches it to the deal record in your crm 1 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 picture below 2 create parent folder using โcreate folderโ action create folder action can be used to create folders in any location on any cloud storage platform from hubspot flow action we will use this action to first create the parent folder to use the โcreate folderโ action, simply click on add button and search for โcreate folderโ as shown below once you add this action, it will ask you to fill in certain parameters this action requires a few parameters the library parameter refers to the cloud storage service (like google drive, sharepoint, etc ) where you want to create the folder simply choose your preferred storage option from the dropdown menu the folder name is the name youโd like to assign to the newly created folder in most cases, we use the dealโs name for simplicity, but you can also use a custom text formula or variable to generate more complex names youโll also need to provide values for the shared drive id and path to destination these are shared drive id โ this applies only to google drive and sharepoint users these platforms support multiple โdrivesโ where documents can be stored youโll need to specify which one to use path to destination โ this defines the exact location (folder path) where the new folder should be created inside your selected storage you can easily copy these parameters from the cloudfiles app just follow these steps locate the cloudfiles widget on any hubspot record and click on cloudfiles youโll be redirected to your connected cloudfiles storage under the libraries tab, navigate to the folder where you want to save your files, or create a new one on the right side of the screen, youโll see a metadata section copy the required parameters from there check the gif below for a quick walkthrough of these steps for a detailed description of the create folder action, refer to the create folder detailed guide hereโs how our final create folder action looks like 3 show parent folder on deal record using โcreate attachmentโ action the create attachment https //help cloudfiles io/hubspot/create attachment action action is used to link the newly created folder to a hubspot record attaching (or associating) the deal folder is essential because it allows you to view and manage the folderโs contents directly from within the hubspot record itself to use this action, click on the add button and search for โcreate attachmentโ as shown below after adding the action, youโll be prompted to enter a few parameters the shared drive id and library fields will remain the same as mentioned earlier the path to folder is the full and exact folder path of the parent folder you created you can easily copy this path from the metadata section in the cloudfiles library, just follow the same steps described earlier for getting the shared drive id hereโs how our final create attachment action looks like section 2 attach the same folder to the dealโs contacts in this section, weโll use that same folder and connect it to the contacts associated with the deal, so everyone has access to the same folder 1 create a contact based workflow to set up the workflow, start by creating a new contact based workflow from scratch in hubspot for the trigger, select the option to fire when a new deal is created and whenever a contact is associated with any deal to ensure the workflow only runs when the deal has a folder attached, add a filter condition using the cloudfiles property called "number of resources attached" and set it to equal 1 this filter ensures that the first workflow, which creates the folder for the deal, has already run, so this workflow only proceeds when a resource (folder) is linked to the associated deal to learn more about the cloudfiles properties that can be used in workflows and triggers, refer to all cloudfiles properties docid\ muihjnxiozafrtxeble26 2 show deal folder on contact record using โcreate attachmentโ action we will follow the same steps that we had followed previously the create attachment https //help cloudfiles io/hubspot/create attachment action action is used to associate created folder to hubspot records attaching (or associating) our newly created deal folder is important since this will enable us to see and operate on the folder contents right from the hubspot record the parameters such as library , shared drive id , and path to file or folder will remain the same as those used in the create attachment action within the deal based workflow however, when you try to insert the " deal name" token while configuring the folder name at the end of the path to file or folder parameter, you will notice that the token does not appear if you select enrolled contact in the view "properties or action outputs from " section to make the " deal name" token available click edit available records in the edit available records dialog, click add records provide a name for the data source (e g , deal) set the record type to deal define a condition to filter the deals condition if associated to the enrolled contact association label all associated deals condition to filter deals most recently created this setup ensures that the path to file or folder parameter can include the deal name from the most recently created deal associated with the enrolled contact hereโs how our final create attachment action looks like test the automated folders in action now that everything is set up, itโs time to test the workflow start by creating a new deal in hubspot and associating one or more contacts to it the workflow might take a few seconds to run, so give it a moment and refresh the page if needed next, go to the cloudfiles connected folder widget tab in the middle section of the deal record you should now see the newly created deal folder right there in the deal record, and the same folder will also appear under the associated contactโs records this is shown in the gif below enabling re enrollment if someone creates a new deal for an existing contact, for example, if you are associating another deal with a contact that already exists in your crm and you want a folder to be automatically created and linked to that contact record again, make sure the re enrollment option is enabled in your workflow this allows the workflow to run again for the same contact whenever a new deal is associated