Extension pointers for integrating Zoho CRM with Zoho products #8: Upload and manage Zoho Workdrive folders and files from within Zoho CRM

Extension pointers for integrating Zoho CRM with Zoho products #8: Upload and manage Zoho Workdrive folders and files from within Zoho CRM

Keeping records on your customers and business prospects is essential for tracking data, conducting follow-ups, and running a business smoothly. When you use two separate applications, and store relevant data in each, checking and tracking data becomes more difficult.
 
Integrating applications that contain customer data is an effective solution for easily synchronizing and managing data across both applications. In this post, we'll look at how to integrate Zoho CRM with Zoho Workdrive in order to synchronize and manage Workdrive files and folders associated with a CRM contact across both applications.
 
Consider the following scenario: You've converted a lead to a contact in Zoho CRM. Now, you must associate files with that contact, such as legal documents or proofs. To do this, you can create a team folder where every team member can access and manage the contact's folders and files. 
 
In order to store contact-specific files, you can create a new folder (within the team folder) for each WorkDrive contact by clicking a button within their CRM record. You can even create a widget for uploading files to the contact's Workdrive folder from within CRM. 
 
Create a connector for Zoho Workdrive and add connector APIs
  • Create a new connector in your Zoho Workdrive extension using the Connectors feature under Utilities in the left-side panel of the Zoho Developer console. 
Note: Zoho Workdrive follows OAuth 2.0 protocols for authentication. You can learn how to register Zoho products and retrieve your client credentials here.
 
                                                
 
The connector details for the above example are as follows:

Request Token URL
https://accounts.zoho.com/oauth/v2/auth?scope=,WorkDrive.users.READ,WorkDrive.files.CREATE,
WorkDrive.teamfolders.CREATE&access_type=offline
Access Token URLhttps://accounts.zoho.com/oauth/v2/token
Refresh Token URLhttps://accounts.zoho.com/oauth/v2/token
Scopes
WorkDrive.users.READ,WorkDrive.files.CREATE,
WorkDrive.teamfolders.CREATE
                                                 
 
The Zoho Workdrive REST APIs we added for our example are as follows:
 
Connector API NameMethod typeURL
Get ZUIDGEThttps://www.zohoapis.com/workdrive/api/v1/users/me
Get all teams of a userGEThttps://www.zohoapis.com/workdrive/api/v1/users/${zuid}/teams
Create team folderPOSThttps://www.zohoapis.com/workdrive/api/v1/teamfolders
Create new folderPOSThttps://www.zohoapis.com/workdrive/api/v1/files
File uploadPOSThttps://www.zohoapis.com/workdrive/api/v1/upload?filename=${file_name}&parent_id=${file_parent_id}&override-name-exist=true
 
Note: You can refer to this post to see the detailed steps involved in creating a connector, adding the connector APIs, and associating them with the extension.
 
Create a settings widget to build team folder and assign them to Workdrive teams 
  • Create a settings widget to select a team to manage a contact's folders and files.
  • We'll also create a CRM variable called "Team Folder ID" to store the assigned team's ID information for future operations.


Settings widget.js code snippet
Util={};
var teamidvalue;
 
   //Subscribe to the EmbeddedApp onPageLoad event before initializing the widget 
   ZOHO.embeddedApp.on("PageLoad",function(data)
  {
var data =  {
    }
 
//Invoking the 'Get ZUID' API to retrieve the user's ZUID
ZOHO.CRM.CONNECTOR.invokeAPI("xxx.workdrive.getzuid",data)
.then(function(dataa){
    console.log(dataa);
    response = dataa.response
    responsejson=JSON.parse(response);
    zuiddata=responsejson.data;
    zuid=zuiddata.id;
 
    var data =  {
          "zuid" : zuid
    }
//Invoking the 'Get all teams of a user' API to fetch all the teams of a user
ZOHO.CRM.CONNECTOR.invokeAPI("xxx.workdrive.getallteamsofauser",data)
.then(function(dataa){
    console.log(dataa);
    response = dataa.response;
    responsejson=JSON.parse(response);
    teamdata=responsejson.data;
 
  for (i = 0; i < teamdata.length; i++) 
    {
 
      teamid=teamdata[i].id;
      attributes=teamdata[i].attributes;
      teamname=attributes.name;
      var teamlist = document.getElementById("teamlist");
      var option = document.createElement("OPTION");
      option.innerHTML = teamname;
      option.value = teamid;
      teamlist.appendChild(option);
    }
    })
})  
})
    Util.getvalues=function()
    {
//Retrieving the value chosen in the teamlist
      teamidvalue=document.getElementById("teamlist").value;
/*Constructing data and passing to 'Create team folder' API to create a team folder called "CRM Contacts test"*/
var data =  {
 
          "extension_team_folder_name" : "CRM Contacts test",
          "parent_id":teamidvalue
    }
ZOHO.CRM.CONNECTOR.invokeAPI("xxx.workdrive.createteamfolder",data)
.then(function(dataa){
    console.log(dataa);
    response = dataa.response;
    responsejson=JSON.parse(response);
    teamfolderdata=responsejson.data;
    teamfolderid=teamfolderdata.id;
 
//Set the ID of the team selected in the teamlist to the "Team Folder ID" CRM variable
          var variableMap = { "apiname": "xxx__Team_Folder_ID", "value": teamfolderid};
ZOHO.CRM.CONNECTOR.invokeAPI("crm.set", variableMap);
 
ZOHO.CRM.API.getOrgVariable("xxx__Team_Folder_ID").then(function(data){
  console.log(data);
});
});
    }

 
Create a button in the Contacts module to make a new Workdrive folder for a contact
  • Create a button called "Create a new workdrive Folder" using the Links & Buttons feature available in the Components section of the Zoho Developer console. Then, write a function to perform the desired action.
  • For our use case, since we're creating a new folder specific to a contact inside a WorkDrive team folder, we'll create the folder with the Full Name of the Zoho CRM contact.
  • We'll also create a custom field in the Contacts module called "Folder ID" to store the ID of the new Workdrive folder to perform future operations.
Create a new Workdrive folder: Function code snippet

//Fetching the current contact details and retrieving the Full Name and custom field folder ID of the contact
response = zoho.crm.getRecordById("Contacts",contact.get("Contacts.ID").toLong());
Fullname = response.get("Full_Name");
contactfolderid = response.get("xxx__Folder_ID");
if(contactfolderid == null)
{
/*Invoking the 'Create new folder' API to get create a folder in Workdrive for the Zoho CRM contact with the name as their Full Name*/
parentfolderid = zoho.crm.getOrgVariable("xxx__Team_Folder_ID");
dynamic_map = Map();
dynamic_map.put("name",Fullname);
dynamic_map.put("folder_parent_id",parentfolderid);
 
newfolderresp = zoho.crm.invokeConnector("xxx.workdrive.createnewfolder",dynamic_map);
newfolderresponse = newfolderresp.get("response");
newfolderdata = newfolderresponse.get("data");
newfolderid = newfolderdata.get("id");
contactinfo = {"xxx__Folder_ID":newfolderid};
/* Updating the 'Folder ID' custom field in contact's record with the new folder ID obtained from the response*/
folderresponse=zoho.crm.updateRecord("Contacts",contact.get("Contacts.ID").toLong(),contactinfo);
 
return "A new workdrive folder has been created with the ID - " + newfolderid;
}
else
{
return "Folder already present for contact in Workdrive";
}
  • The above code snippet fetches the record details for the current contact to retrieve the customer's Full Name. 
  • The Workdrive parent folder ID (set using the settings widget), where the new folder for the contact will be created, is then retrieved using the getOrgVariable deluge task . 
  • The parent folder ID and the contact's Full Name are delivered to the Create new workdrive folder API to create a new folder for the contact in Workdrive.
  • The ID of the new folder is then updated in the "Folder ID" custom field using updateRecord task. 
Create a button in the Contacts module to upload files to a contact's Workdrive folder and associate it with a widget
  • Create a button called "Upload file to Workdrive" using the Links & Buttons feature available in the Components section of the Zoho Developer console, then associate a widget to perform the desired action.
Upload file to workdrive - widget.html - Please find the attachment for the widget html code.
  • The code snippet fetches the record details of the current contact, from which the custom field 'Folder ID' value is retrieved. 
  • The input file selected is also checked for its file type and name.
  • The Folder ID and the file name are then constructed and passed as parameters to invoke the 'Upload File to Workdrive' API.
Sample output
  • After installing the extension, authorize the Zoho Workdrive connector.
  • Go to Settings on the extension configuration page.
  • Choose a team to manage the contact's folders and files. Click Save.
                                    
  • A new team folder, CRM Contacts test, is created in Zoho Workdrive for the chosen team.                                    
  • Go to the Contacts module. Click on the Create a new workdrive folder button on the record's view page.                                     
  • A new folder is created in workdrive with the name of your contact.                          
  • Once the folder is created, the custom field, Folder ID is also automatically updated with the new folder ID value.                         
  • Now, click on the Upload file to Workdrive button on the record's view page.                    
 
  • The widget appears. Choose a file and click the Upload file to Workdrive button. The file will be uploaded to Workdrive.
                                     
Using this method, you can integrate Zoho CRM with Zoho Workdrive through an extension to perform necessaryfunctionalities for your business. We hope you find this information helpful! 
 
In our next post, we will show you how to track, view, and access these Workdrive files within Zoho CRM. Keep following this space for more advice!


SEE ALSO


    • Recent Topics

    • Create new ticket when another specific ticket is closed

      Hi. How can I create a ticket when another specific ticket is closed? So I have a ticket with subject 'Create agreement' connected to the contact of a customer. As soon as I close this ticket, I want that a new ticket is created (connected to the same
    • How can a Zoho Desk Admin access restricted files?

      How can a Zoho Desk Admin access restricted files from Zoho Desk that are not displayed to agents on tickets due to file type restrictions?
    • Why is my Lookup field not being set through Desk's API?

      Hello, I'm having trouble setting a custom field when creating a Ticket in Zoho Desk. The endpoint I'm consulting is "https://desk.zoho.com/api/v1/tickets" and even though my payload has the right format, with a "cf" key dedicated to all custom fields,
    • Ticket template - Send email to multiple contacts

      Is it possible to set up a ticket template with multiple contacts selected to receive an email, rather than just one contact as the default? We use Zoho Desk to send an email report to a group of contacts every day, and have to manually add each email
    • Multiple Zoho Attendees in a Customer meeting

      We are having constraints with having to log duplicate meetings when we have 2 Zoho users attending a customer meeting. What are the options to resolve this? You can add participants, but you cannot report on them. What can be done to avoid creating so
    • Enrich your CRM data and keep them updated

      You spend a lot of your time and efforts in generating quality leads for your business. While generating leads is a challenge in itself, the real deal begins when sales reps try to nurture these leads and convert them as customers. So how equipped is your sales team with information about your leads matters a lot.  For example, you might be using webforms to generate leads and collect customer information from your website. The lesser your webform fields are, the more your sign-ups right? From optimizing
    • Feature Request – Support for Stripe Direct Debit for Canadian Customers in Zoho Books

      I’d like to request support for Stripe Direct Debit as a payment option for Canadian customers within Zoho Books. Currently, while Stripe credit card payments are supported for Canadian businesses, there is no option to enable Direct Debit (ACH/EFT) through
    • Client Script also planned for Zoho Desk?

      Hello there, I modified something in Zoho CRM the other day and was amazed at the possibilities offered by the "Client Script" feature in conjunction with the ZDK. You can lock any fields on the screen, edit them, you can react to various events (field
    • Zoho desk domain mapping not working

      Hi, I have followed this knowledge base support from your zoho site: https://help.zoho.com/portal/kb/articles/support-customers-from-your-own-domain-domain-host-mapping . First created a sub-domain(support.website.com), then went to zone editor to point "support.website.com" to cname desk.cs.zohohost.com . But it won't work out. What did I lack? Please I need it very much. Please see images below of the result: Please see below images of what I did: 1.)  2.) 3.) Hope to hear from you soon.
    • Zoho Analytics pulling data from Zoho Sheets and Zoho Forms

      It would be smart to have Analytics import data from Zoho Sheets or Forms. 
    • Feature Request – Support for Saskatchewan PST Self-Assessment in Zoho Books

      I’d like to suggest a feature enhancement for Zoho Books regarding Saskatchewan PST (SK PST) self-assessment. Currently, when filing the SK PST return using Zoho Books’ return generator, there is a field labelled “Consumption Tax”, which is intended for
    • Exporting Presentations with Embedded Integrations

      I am embedding Zoho Analytics charts and tables - how can I export the presentations so that the embedded images show ? At the moment it just shows broken images . *note* I do not need the exports to have the live data or links - just a snapshot of what
    • Bug in Total Hour Calculation in Regularization for past dates

      There is a bug in Zoho People Regularization For example today is the date is 10 if I choose a previous Date like 9 and add the Check in and Check out time The total hours aren't calculated properly, in the example the check in time is 10:40 AM check
    • Embedding Zoho Analytics - is the data always 'live' ?

      When embedding "live" Zoho Analytics data into a template with the intention of creating a monthly presentation - how are the embedded filters saved ? When a filter is applied to a presentation from a template is it then fixed for sharing or will it always
    • Customer/item(s) bought view

      Hello In Inventory/Customers/Transactions tab, how do I see what it is the customer actually ordered/bought without having to open each SO? Our customers buy a number of items thoughout the year. I've look at each transactions drop down, and no-where
    • Zoho Flow Doesn't Detect Desk Ticket Custom Field Change

      I have a Flow that is configured to be triggered when a custom field on a ticket changes. I also have a Schedule in Desk that runs a script that changes the custom field. When I change the custom field manually in the Desk interface, the Flow runs as
    • Weekly Tips: Track Email Engagement with Read Receipts in Zoho Mail

      While email is a convenient and widely used way to communicate, it doesn't offer the immediate feedback you get from face-to-face conversations or phone calls. When we send an email, there is no way to know for sure if the recipient has acknowledged its
    • Reusable Variables

      I’d like to know if there’s a way to store variables in Zoho Analytics that I can use in metrics or calculations. For example, I have a Currencies table that stores the value of different currencies over time. I’d like to use the value of the US dollar
    • The Invoice Status in Zoho Finance is misleading

      We have many overdue invoices, but when we try to filter it by Status Overdue in the Zoho Finance Module it shows it as none This is also creating a problem when I need to Create a Chart or KPI for overdue Invoices If I open the Invoice I can see the
    • Zoho CRM's V8 APIs are here!

      Hello everyone!!! We hope you are all doing well. Announcing Zoho CRM's V8 APIs! Packed with powerful new features to supercharge your developer experience. Let us take a look at what's new in V8 APIs: Get Related Records Count of a Record API: Ever wondered
    • If Problema Formula

      Ceil(Datecomp(${Seguimiento de Venta.Fecha de la proxima visita},Now())/1440) Tengo porblema al plantear el If Quiero que si el valor es dega
    • Multi-Select lookup field has reached its maximum??

      Hi there, I want to create a multi-select lookup field in a module but I can't select the model I want the relationship to be with from the list. From the help page on this I see that you can only create a max of 2 relationships per module? Is that true?
    • Customer Portal Zoho Desk | Sort ticket list

      Hello, If you view the ticket list inside the desk portal (https://xyc.zohodesk.eu/portal/de/myarea?departmentId=xyz) all tickets are displayed depending on the filters: department "my tickets" / "team tickets" status group/type channel My questions:
    • HTML Code + Writer Documents

      Hello, I am in the process of writing a couple of documents in Writer. Both document will have 2 versions each. One version being a freebee that perspective clients can download from my website. The other version will be a paid version, and additional
    • This mobile number has been marked spam. Please contact support.

      Hi Support, Can you tell me why number was marked as spam. I have having difficult to add my number as you keep requesting i must use it. My number is +63....163 Or is Zoho company excluding Philippines from their services?
    • Audit Log: Detailed View and Export for Better Tracking

      Audit log tracks all the events or actions performed by the users and displays them in a sequential order. By default, all users who have admin access can view the audit log. We have added new features to the audit log that will enhance the user experience
    • Display All Admin Roles in Zoho One Admin Panel

      Hi Zoho One Team, I hope you're doing well. Currently, in the Zoho One Admin Panel, we can see Org Admins and Service Admins assigned to specific applications. However, admins assigned at the organization level for various Zoho apps (such as Mail, Cliq,
    • Enable users to create and edit presentations in your web app using Zoho Office Integrator

      Hi users, Did you know that your users can create, edit, and collaborate on presentations from within your web app? With Zoho Office Integrator's embeddable presentation editor, you can easily add these capabilities. Here are the highlights: Create presentations:
    • Forced Logouts - Daily and More Frequent

      In the last month or so, I've been getting "power logged out" of all of my Zoho apps at least daily, sometimes more frequently. This happens in the same browser session on the same computer, and I need to re-login to each app separately after this happens.
    • I can buy a Domine

      I need assistance with an issue I'm experiencing. Whenever I attempt to purchase a domain, I receive a message that says, "We ran into some trouble. Please try again later." I would greatly appreciate any help you can provide. Thank you. Please refer
    • What's New in Zoho Inventory | January - March 2025

      Hello users, We are back with exciting new enhancements in Zoho Inventory to make managing your inventory smoother than ever! Check out the latest features for the first quarter of 2025. Watch out for this space for even more updates. Email Insights for
    • Zoho Customer Statements open item and NOT balance brought forward

      How do I set my customer statements to open item and NOT just the balance brought forward. I would like the customer to see all the invoices outstanding
    • Free Webinar! From click to doorstep delivery | Enhance your ecommerce fulfillment process

      Free Webinar! From click to doorstep delivery | Enhance your ecommerce fulfillment process April 24, 2025, 12 p.m. EDT As your business grows into the ecommerce sector, so do the complexities of fulfillment. From managing real-time inventory to handling
    • Zoho Books Invoice Enable Payment Gateway with Deluge

      I am using this to create an invoice record in zoho books from zoho crm invoices. I want to add the ability to enable online payment gateway for "stripe".  I can not seem to find one article online on how to do this.  Can someone help? invoice = zoho.crm.getRecordById("Invoices",id);
    • Issue List Export

      When viewing all Tasks, there are options to filter the list and export. With the Issue list, I can filter, but not export the list. Is there somewhere else to go to get an exported list of filtered issues?
    • Ask the Experts 19: Live Expert Panel Discussion - Inside Zoho Desk Spring Release 2025

      Hello again! Have you ever needed quick insights into key indicators to help manage and streamline specific operations? Have you started using AI to enhance your customer service in Zoho Desk? From configuring simple bots using Guided Conversations to
    • Viewing Live data

      Where can I see the live data that is sent from the device?
    • Calculating Project Margins and Revenue per Hour in Zoho Analytics Using Data from Zoho Projects and Zoho Expense

      Hello, I would like to know if it's possible to use Zoho Analytics to calculate taxes and margins for the projects available in Zoho Projects, while also including the expenses recorded in Zoho Expense. I’m looking to build a dashboard that calculates
    • NOW Zoho Creator still cannot bulk download Image or File Upload Field

      The filedownloader has been deprecated for 5 years. Until now, we still cannot have a replacement tool. How can we bulk download the file that we uploaded to Zoho Creator. Previously, it was so simple to bulk download all those files. But now failed to
    • Having issue adding email account

      Hi Sir/Madam, I having an issue adding an email account (user and group). We have two organization but I am getting an error while adding the account in both User and group. Yet the account is not there. See attached.
    • Next Page