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

    • Subject: Urgent: Unrelated Email Automation Issue – Request for Immediate Resolution

      Dear Zoho One Support Team, We are currently facing a critical issue with email automation in our Zoho One account. Despite deleting the associated templates and workflows, the same email templates are still being sent to our customers. This has become
    • Zoho Sites

      Does anyone have experience building Zoho sites or know how I can find someone who does?
    • Tip of the week 63- Know your contacts well with polls in Zoho Campaigns

      Communication in its true form is characterised by feedback. In email campaigns there are a few avenues via which you can achieve this. Using polls in Zoho Campaigns is one such way. With polls enabled in campaigns, your contacts can interact with your emails and help you understand them well.     There are three types of polls available to be enabled in your email campaigns:   Basic poll Rating based poll Reaction based poll     Basic poll-    Provide a question and allow the email recipients to
    • CRM->INVENTORY, sync products as composite items

      We have a product team working in the CRM, as it’s more convenient than using Books or Inventory—especially with features like Blueprints being available. Once a product reaches a certain stage, it needs to become visible in Inventory. To achieve this,
    • Relocating from Zoho Connect External to Zoho Connect Internal or Zoho CommunitySpaces... or move off of Connect completely.

      This conversation is aimed at Zoho clients that currently use Zoho Connect's External network platform. As I discovered in the comment section of another post, Zoho Connect is halting development of Zoho Connect EXTERNAL networks in favor of the new Zoho
    • Limited review (/questions) for Bookings 2.0

      Hi all, I'm writing this review of Bookings 2.0 for two reasons: 1) it may be of interest to others, and 2) I'd like to be corrected if I'm wrong on any points. It's a very limited review, i.e. the things that have stood out as relevant, and particularly
    • Recurring Events Not Disappearing from Zoho Calendar When Canceled by Organizer

      I receive a recurring meeting invitation to my Gmail address, The event correctly appears in my Zoho Calendar, since I have Gmail calendar integrated/viewable via Zoho Mail. When the organizer cancels one occurrence, the canceled meeting does not disappear
    • Create Funnel to Track Email Outreach Conversion

      Hello, We would like to create a funnel that measures: N° of emails sent -> N° of emails opened -> N° of emails responded We would like to measure this email response conversion rate for each of our SDRs. We use the analytics tool of Zoho CRM and not
    • is Zoho desk down ?

      We have not received any tickets via email on the Zoho desk for the past hour. I also tried sending several test emails, but as of right now, no new ticket has been created on the desk.
    • Relay Mail Failed

      Hello, We are using SMTP Relay Settings in ZOHO CRM for sending emails using office 365 server. But every time we are receiving below errors. The Relay Configuration for the domain Domain.com and feature WorkFlow has failed 3 times today . Mails will
    • Can't lock timezone in new Zoho Bookings

      Hi, since the new Zoho Bookings has been changed, I cannot seem to lock the timezone in for the meetings. I have set the working hours and location, but when I got on the link, it automatically gives me slots in my timezone. I want to lock it for an in-person
    • Leverage layout rules to customize workflow

      Layout rules in Zoho Sprints primarily aim to customize the field layout of your creation forms to meet complex requirements. But it doesn't stop there. Its customization can push the boundaries of how your fields behave, how data is gathered, how processes
    • Auto-Generate & Update Asset Serial Numbers using a custom function (Assets Module)

      Hello Team, I’ve been working on a script to automate one of our processes in Zoho FSM, and the core functionality has been successfully implemented. However, I’m encountering an issue related to serial number allocation, which is not working as expected.
    • CRM Hack #3: How to update formula functions for already created records.

      Hello everyone! It’s Wednesday and we are back with yet another hack.. I'm sure you've used formula fields to meet some requirements specific to your business. Let's consider an example each for external (customer-facing) and internal facing scenarios
    • Leave request for 0 hours is registed as 24 hours

      I have configured workschedules for all my employees, so the leave request for them whould be a lot easier. In that spirit I have configured a shift from 9 to 9 with a total duration of 0 hours. When a employee fills in a leave request for lets say a
    • How can I see sent mail ?

      Hi, When you send a sale order or invoice to the customer using the email function, where can bee seen the sent email ? I can't find it in the "sent" folder of my mail client, nor I can't find it in the mail Related list under the company or the contact.
    • Add RTL (Right-to-Left) Text Direction Support Across All Zoho Learn Editing Interfaces

      Hi Zoho Learn Team, Hope you're doing well. We would like to request an important enhancement to Zoho Learn regarding support for right-to-left (RTL) languages such as Hebrew and Arabic. 🔹 Current Issue While the Knowledge Base Article editor provides
    • Nimble enhancements to WhatsApp for Business integration in Zoho CRM: Enjoy context and clarity in business messaging

      Dear Customers, We hope you're well! WhatsApp for business is a renowned business messaging platform that takes your business closer to your customers; it gives your business the power of personalized outreach. Using the WhatsApp for Business integration
    • Formula Fields inside of Blueprint Transitions

      We would like to have formula fields inside of blueprint transitions. We type in currency fields and would like to see the result inside of a formula field. Our use case: Send out a price for XY 1. Filling out cost fields 2. See gross profit
    • Zoho Creator Populate radio field with values with all the created rows subfor

      I have Main Form where i have a lookup field where i get brewery names and the number of tanks as a multiline text field with a list of beer names Based Brewery selected and bbt_tanks number i create rows in the subform and now i want to populate list
    • Recording Credit Card Fees when Recording Payment for Bills

      It seems I am unable to record credit card fees when paying a bill. I pay close to 100% of my bills with a company credit card via online portals. I'm happy for the CC fess to be recorded as Bank Charges but it will not allow that field to be used if
    • Search function in Zoho Sheet mobil app on android - not working

      Hello, Im new here and registered for Zoho Sheet. Than i installed the android mobile app on my tablet (redmi note pro 5g). But I cant use the search function for my added excel table. When I use the web version for zoho sheet with the same imported table
    • Error AS101 when adding new email alias

      Hi, I am trying to add apple@(mydomain).com The error AS101 is shown while I try to add the alias.
    • Zoho Books | Product Updates | April 2025

      Hello partners, We’ve rolled out new features and enhancements to elevate your accounting experience. From FEC report to BillPay Add-on, these updates are designed to help you stay on top of your finances with ease. Export Transactions in Factur-X Format
    • How to control the # of version of files to keep?

      Currently most of the WorkDrive Storage comprise of the many versions of files saved. How do I save some space and reduce the number of version of date or files saved in WorkDrive? Thanks
    • Creating Layout Rule With Formula Field

      By The Grace Of G-D. Hi, I see that i cannot use Layout Rules to show/hide Formula Fields. Is that something you plan on adding sometime soon?
    • Rich-text fields in Zoho CRM

      Hello everyone, We're thrilled to announce an important enhancement that will significantly enhance the readability and formatting capabilities of your information: rich text options for multi-line fields. With this update, you can now enjoy a more versatile
    • Meet Zoho Sign's AI answer bot!

      Hi partners, Our goal has always been to ensure all our resources are readily available for our users. With this in mind, we're excited to introduce Zoho Sign's answer bot, a solution designed to help users instantly find relevant help articles by eliminating
    • is it possible to add more than one Whatsapp Phone Number to be integrated to Zoho CRM?

      so I have successfully added one Whatsapp number like this from this User Interface it seems I can't add a new Whatsapp Number. I need to add a new Whatsapp Number so I can control the lead assignment if a chat sent to Whatsapp Phone Number 1 then assign
    • Widget JS SDK to Upload a photo to a record in a Module

      Good day,  I would really appreciate it if someone can assist me. I have written a widget, to be used in a Custom Module in CRM.  My goal: I want to upload a photo from my computer and display it in die "upload image" field. I am using the JS SDK: https://help.zwidgets.com/help/v1.1/index.html
    • Making emails and notes private......

      Having experience using a plethora of CRM's I have noticed that this is one of the pitfalls of Zoho. Many notes and emails we want to add to Zoho we would like to make private or only visible to a set group of people.  The attached image from another CRM displays this feature.  While company policy at some firms could be that all information added to the CRM is public information.  This is a two way street.  Lots of companies have employees that are independent contractors in sales industries like
    • Search WorkDrive File Contents from Creator

      Good afternoon, I am building out a Creator app where I want to allow users to input search terms from Creator that will return the appropriate files that contain those keywords from their Creator search. Is this possible?
    • LinkedIn X-ray Search on Google

      Are there any workarounds or ways to extract mutliple Linkedin Profiles from a google Linkedin X-Ray search. My ideal would be copy the X-Ray search
    • How to send invoices to 2 emails?

      Hi! We are sending invoices to the "Customer email" field that is defined Zoho Books and is obtained/synced from a custom email field in Zoho CRM. But in some clientes, the invoices have to be sent to 2 emails and we are wondering how this could be accomplished.
    • 2 Ideas, Clone timesheet entry from monthly view and Notes in Weekly view

      While i love timekeeping I am finding some things slow me down.  Slow to the point of considering writing my own API call to do this. It would be so useful to be able to clone a timesheet entry from the monthly view.  It is somewhat painful to have to
    • A few Issues when using "Pay Bill via Check"

      We have quite a bit of issues with how paying for Bills via Check works. Would love some feedback from the Zoho team in case we are doing something incorrectly. 1. When we go from a vendor and select "Pay Bill via Check" option, we see ALL the outstanding
    • Writing a single vendor check for multiple bills

      I need to be able to create a single payment for 15 to 75 bills.  We have a few vendors that bill us per transaction.  During our heavy sales season those vendors will send as many as 40 bills per day and we pay these bills weekly. The check wringing
    • Zoho CRM mobile: support for record images, predefined WhatsApp messages, and multi-select lookup field

      Hello Everyone We've made a few enhancements to the Zoho CRM mobile app to improve your experience. Here’s what’s new: Extended record image support for modules (Android) Predefined text support for WhatsApp messages (Android) Multi-select lookup field
    • Exciting Updates to the Kiosk Studio Feature in Zoho CRM!

      Hello Everyone, We are here again with a series of new enhancements to Kiosk Studio, designed to elevate your experience and bring even greater efficiency to your business processes. These updates build upon our ongoing commitment to making Kiosk a powerful
    • How can I bulk import product images to Zoho crm.

      How can I import product images to Zoho crm within bulk imports. I am using an excel sheet or csv and want to include an image (via URL) for each product. This topic is the closest I have found to a solution but I need further help to implement it: https://help.zoho.com/portal/en/community/topic/import-file-upload-and-image
    • Next Page