If you use Zoho WorkDrive to store your files, you probably have a folder structure that you like to use for your clients and their deals to keep everything organised. Today, I'll be showing you how you can use some automation inside Zoho CRM to seamlessly integrate it with Zoho WorkDrive. This article will enable you to take your organisation to the next level by leveraging the power to automatically create structured client folders in Zoho WorkDrive from Zoho CRM. Say goodbye to manual folder setup and hello to a streamlined process that automatically generates a dedicated deal folder for each of your deals inside the clients folder.
Folder Structure
Below is the folder structure that we will be implementing, it contains a central 'Clients' folder that will hold the client folders created for Contacts and Accounts. Inside each client folder, there will be a "Deals" folder to house individual deal folders.
It's worth noting that the 'Deals' folder will only be created inside the client's folder when there is a deal folder to be added. This approach ensures a clean and organised structure, with the Deals folder dynamically generated as needed.
How It Works
Each module will have a "Create WorkDrive Folder" Button. When this button is clicked it will create the WorkDrive folder for the record selected, be that a Contact, Account or Deal.
Contacts or Accounts
When clicked on a Contact or Account record, the "Create WorkDrive Folder" Button will generate a single client folder in the 'Clients' team folder. The client folder will be named using the Client Number (or equivalent unique field) prefixed before the Name of the Contact or Account. Subsequently, the WorkDrive folder will open in a new browser tab. If a WorkDrive folder already exists for the Contact or Account, the button will merely open the folder in a new tab.
Deals
When clicked on a Deal record, the "Create WorkDrive Folder" Button will follow the below logic to determine the client and create the relevant folder structure:
If the 'Account Name' field is populated, the Account associated with the Deal will be considered the Client.
If the 'Account Name' field is empty, and the 'Contact Name' field is populated, the Contact associated with the Deal will be considered the Client.
If both the 'Account Name' and 'Contact Name' fields are empty, the user will receive an error message indicating that a client folder cannot be created.
If a client WorkDrive folder is identified based on the above logic, the function will proceed to:
Locate or create (if it doesn't exist) a folder called 'Deals' within the client folder.
Create a deal folder with the name of the specific Deal.
Open the WorkDrive folder for that Deal in a new browser tab. If the WorkDrive folder already exists for the Deal, the button will open it in a new tab.
Trigger Method
If you're wondering why I choose a manual button to trigger the WorkDrive folder creation over a fully automated creation this really comes down to personal preference. But there is some method behind my madness and heres why.
Fully automated WorkDrive folder solutions tend to create a bunch of empty folders that might not ever have data added into them
You can always add automation in later, for example when a deal gets to a certain stage
A button can be configured to give you immediate feedback if there is a failure or an issue with the creation of the folder (This is not configured in this code example to reduce complexity)
If there is a failure with the automated solution a button is often required to re-trigger the automation, especially if folders are created "On Creation" of a record
Note: If you want your solution to be automated you can use the same code provided in this article and attach it to a workflow.
Zoho WorkDrive Configuration
To implement the folder structure as described earlier, the first step is to create a new folder named 'Clients' under Team Folders in your Zoho WorkDrive. This folder will serve as the central repository for all client-related folders.
Once you have created the 'Clients' folder, make sure to save its full URL, as this will be a crucial piece of information for our function. The URL will be used to ensure seamless integration and easy access to the 'Clients' folder when we proceed with the automation.
Zoho CRM Configuration
To enable this automation, specific field configurations are required within each of the 3 modules in Zoho CRM.
Since Zoho WorkDrive doesn't allow duplicate folder names within a folder, we'll need to add a unique value to the folder name. For this automation, we'll configure an Auto-number field in both the Contacts and Accounts modules, i've named it 'Client Number' however you can name it whatever you like. To ensure distinct prefixes for each module, we'll use 'A' for Accounts and 'C' for Contacts. If you frequently encounter deals with the same name under a contact/account, you might also consider creating an auto-number field for the Deals module.
Furthermore, in all modules, we need to create a single-line text field called 'WorkDrive Folder ID.' This field will store the WorkDrive folder ID on the respective record after it's created by our function.
Connections
As apart of this automation as discussed above we will on occasion need to trigger our Contact and Account WorkDrive folder button functions by API as well as needing to create and read folders in Zoho WorkDrive. We will need 2 connections for this, of course you can put them into a single connection if you prefer, I just opt to keep my connections seperate for each application.
Connection Names and Scopes
crm_connection
ZohoCRM.functions.execute.READ
ZohoCRM.functions.execute.CREATE
workdrive_connection
WorkDrive.files.ALL
Head to Settings > Developer Space > Connections
Click Create Connection
Select Zoho OAuth
Enter a Connection Name
Select the required scopes (listed above).
Click Create and Connect
Click Connect
Select your Production System
Click Accept
Functions
We will be creating 3 button functions for this automation and the code is provided below.
To create a function go to Settings > Developer Space > Functions
Click New Function
Enter a Function Name (No Spaces)
Enter a Display Name
Set the Category to Button
Click Create
Enter code below
Click Save
We need to expose the Account and Contact Buttons by the API so that we can trigger them from the Deal button if there is no client folder created yet.
To expose a function via REST API go to Settings > Developer Space > Functions
Click the ellipsis next to the function
Select REST API
Check the OAuth2 Toggle
Copy the URL that appears
Contact Client WorkDrive Folder Function
Create a new function with the Category as "Button"
Enter the WorkDrive Client Folder URL in the function
Once saved, expose this function by REST API and take note of the URL
Account Client WorkDrive Folder Function
Create a new function with the Category as "Button"
Enter the WorkDrive Client Folder URL in the function
Once saved, expose this function by REST API and take note of the URL
Deal WorkDrive Folder Function
Create a new function with the Category as "Button"
Enter the WorkDrive Client Folder URL in the function
Enter the Account Client WorkDrive Folder Button OAuth2 URL
Enter the Contact Client WorkDrive Folder Button OAuth2 URL
Adding the Button and Link to the Record
To close out this automation we need to assign the button to each of the modules and create a link that you can use to open the WorkDrive folder.
Adding the Create WorkDrive Folder Button
Go to Settings > Customization > Modules and Fields
Select one of the Modules (Contacts, Accounts & Deals)
Select Links and Buttons Tab
Select 'New Button'
Enter the buttons name 'Create WorkDrive Folder'
Select 'View Page' as to where the button is located
Select 'From Exisiting Actions' for the action the button will perform
Select the function for the relevant module you are configuring
Enter the argument value, press # in the field and select the relevant modules ID
Click Save
Click Save again
Click the Cog Icon to the left of the button you created
Click Set Permission
Select which profiles will have access to this button
Click Save
Repeat this for all Modules (Contacts, Accounts & Deals)
Adding the WorkDrive Folder Link
Although clicking the 'Create WorkDrive Folder' button will open the existing folder if it already exists, the user might prefer to use the link on the side as you have other existing links that relate to the record. Alternatively you can just name the button 'WorkDrive Folder' and it will create/open as required.
Go to Settings > Customization > Modules and Fields
Select one of the Modules (Contacts, Accounts & Deals)
Select Links and Buttons Tab
Select 'New Link'
Enter the link Label 'WorkDrive Folder'
Build your link by adding in your WorkDrive Client Folder URL and removing the last part of that URL which contains 'files' (See below for Example)
Then you can choose the WorkDrive Folder ID field from the Fields Section so it will add that value in dynamically for each record.
You can update the permissions for who can see this link if required.
Click Save
Repeat this for all Modules (Contacts, Accounts & Deals)
Example URL:
https://workdrive.zoho.com/home/phxwy1e9e0a5785f647818cf9f29c13dc9987/teams/phxwy1e9e0a5785f647818cf9f29c13dc9987/ws/h8idl8885465f49fc42849e97ab3733f15e95/folders/${Deals.WorkDrive Folder ID}
I trust that this article has helped provide you with valuable insights and step-by-step guidance to implement a seamless integration between Zoho CRM and Zoho WorkDrive. By following the strategies and instructions detailed here, you can transform your client folder management and deal organisation, bringing efficiency and structure to your business workflow.
Looking to take this automation to the next level, check out my follow up article on how to enhance this automation by maintaining a synchronised client folder structure and displaying the WorkDrive folder contents inside a related list on the record.
Need Help? Contact us!
Resources
Great step by step, but I can hire you to implement this and if so, what is the cost in AUD$