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

      • Zoho books and venmo

        Hi, Is there a way to hook Venmo into zoho books? I have a Venmo business account and want to be able to sync that. I know you can do it with the paypal integration but I dont want to use paypal for the fees and that doesnt allow me use/integrate my current
      • Bandwidth, voice and poor video

        Dear Team, The webinar has made things quite easy and convenient for educators around the world. We are an art & culture-based organization where students and researchers are our major audience.  While using the Zoho webinar platform, we have observed that the audio lags and the video is of poor quality and often freezes. Some participants don't hear what is being spoken.  We also found that even a slightly slow internet connection disrupts the webinar while it should be working well even on lower
      • No Hope for Zoho Meeting

        Zoho Meeting is just the poorest meeting app I've come across in a long time. The support sucks too. I called to see if there was anything that could be done on the backend and while I was on a test meeting with support the video was lagging and freezing
      • Associate Email API Internal Error

        I am trying to associate an already existing email within a function using the Related Emails API. To provide more context, I also have admin permissions and have ensured that the fields are correct and that I have admin permissions when associating the
      • Contacts Don't Always Populate

        I've noticed that some contacts can easily be added to an email when I type their name. Other times, a contact doesn't appear even though I KNOW it is in my contact list. It is possible the ones I loaded from a spreadsheet are not an issue and the ones
      • 550 5.4.6 Unusual sending activity detected. Please try after sometime. <a href=https://www.zoho.com/mail/help/usage-policy.html target=_blank>Learn more.</a>

        Please help me with this. Sending of mails is blocked.
      • Updating Bounced Contacts in Campaigns to the CRM

        The article explains how to update Opt-outs from Campaigns to CRM, but not bounces. While Campaigns will automatically remove any bounced emails from future campaigns, is there a process by which a bounce will update or make a notification in the CRM
      • Zoho Creator Upcoming Updates - December 2024

        Hi all, We're excited to be back with the latest updates and developments on the Creator platform. Here's what we're going over this month: Deluge AI assistance Rapid error messages in Deluge editor QR code & barcode generator Expandable RTF and multi
      • Segmenting Contacts Based on Product Purchased

        I am trying to organize our main Marketing Automation email list in a way that segments contacts based on products they have purchased (for example in this case it is 3 different products). To my knowledge, this would require the sync from Zoho CRM to
      • Update a lookup field in CRM from Creator using deluge

        I have a Creator form that creates a new account. When it creates the new account in the Accounts Module, I need it to also populate the Parent Account, which is a lookup field coming from the Module Parent Accounts, field Parent Account Name. I have
      • Urgent Assistance Needed with DKIM Verification

        Hi, I have been trying to verify the DKIM for the past month using your instructions as well as other resources. Unfortunately, I have not been able to resolve the issue, and it remains persistent. I need to address this problem as soon as possible so
      • Someone made ActiveSync and Autodiscover work, with iOS and macOS

        Hi, I'm trying to set this up for the fifth day now and I"m not getting anywhere. Weird thing is that somewhen in the beginning, I had it working, when I still had VirtualServers and certificates mixed up. But now it's all fine, I have the XML file from
      • How do I attach tasks from one task to other tasks in the same project

        How do I attach tasks from one task to other tasks in the same project
      • Not able to change colors help center

        Hi. How can I change the orange color in the help center? You can change everything besides this font color And how can I remove the part on the bottom?
      • Zoho Books Invoice Salesperson: requires ID but there is no "Fetch salesperson" action

        Hi, I am trying to attach a Salesperson to a Zoho Books invoice. In Zoho Flow, the salesperson field required an ID. However, I only have the salesperson name, I need to fetch salesperson by name and then provide the ID. There is no option to fetch salesperson...
      • Change format of quantity format

        Hi,  I would like to change the qunatity format from 1,00 to 1.  Is this possible?   thanks!
      • Ticket Views: filter criteria -> dynamic date values in relation to the current date

        Hello all, It would be very helpful if you could build custom views in such a way that you do not have to adjust the criteria daily or at whatever interval in order to change the fixed date value as needed. For example, I would like to create a view that,
      • Captchas: No support for Google reCAPTCHA or similar

        Hi all, The current captcha integrated into Creator is very basic, and often near-impossible to read. I'm building an app for a charity which includes a couple of public-facing forms, and this is a real issue for people with dyslexia and related conditions - it's effectively excluding them if you want any form of spam protection at all on your published forms (and that being said, the current captcha doesn't even seem very effective - bots can often read it more easily than humans). I've raised this
      • Maintain consistency in ticket responses with shared snippets

        Hello everyone! We are excited to announce that our highly anticipated snippet sharing feature is now available to all users. As you know, snippets are pre-defined message templates, or canned messages, that help agents respond to tickets with efficiency.
      • Tickets - Zoho Desk

        Hi Team, My Clients need to see their tickets created and the status of the ticket in the Zoho Support Desk itself. How can I do this? My Client doesn't have a Zoho Account. They need to access the ticket by the provided link without signing in.
      • Automatically assign Contacts to Account owners

        Hi, I have a finite number of accounts set up in the CRM, and each new contact that comes in is automatically assigned to an Account according to a rule I set up. I want the Contact owner in the Contacts module to be assigned to the relevant Account owner.
      • Making Copies/Duplicates of Zoho Forms (Shared)

        Question to the community: is there a way to take a 'shared form' , make a duplicate copy and save under My Forms, so that i can use that which was already created as a template to make updates to and use as a test form and be able to have full access,
      • Using IMAP configuration for shared email inboxes

        Our customer service team utilizes shared email boxes to allow multiple people to view and handle incoming customer requests. For example, the customer sends an email to info@xxxx.com and multiple people can view it and handle the request. How can I configure
      • Can you help us creating a customised form with payment link?

        I would like to create a customised Transport form where the user will be asked to make payment basis the drop/ pick up they select.
      • Deleting or disabeling predefined ticket list views

        Is it possible to delete or disable predefined views or is this still not possible? For instance, we are not using the chat function and therefore have no use for the "Missed Chats" view. Thanks!
      • How to restore deleted Field

        I edited a field in zoho form and by accident I deleted a field (email address). The form is ongoing to be filled by respondent. Then, when I checked to the all entries and report, the email address is gone. I checked in audit log, there is a record that
      • Unable to load your extension. Please check your plugin-manifest or Resources.json.

        Hi Team, I am using the config module with multiple fields of different types, such as checkboxes and picklists. However, I am encountering the following issues: Error Message: When loading the extension, I get the error: "Unable to load your extension.
      • Remove or hide default views

        I'm looking to only have the views pertinent to my organization.  Is there a way to show only my custom views (or separate them to a different area or something)? If not, this should be a feature as switching from Zendesk we had this option...
      • No Sales Returns on SO's with Dropped Shipped items + Inventory Items

        We have encountered an issue in Zoho related to sales orders that include both dropshipped items and inventory items. Specifically, it is currently not possible to create sales returns for the company’s own inventory items from these sales orders. This
      • Layout Rules / Quick create

        Hello, is there a way to create a layout rule for quick create option? Regards, Katarzyna
      • Issue with Create Note Button and Popup Form in Leads Module

        Hello Zoho Community, I am trying to implement a "Create Note" button in the Leads module with the following functionality: 1. When the button is clicked, a form should pop up with fields to add notes. 2. After filling out the form and clicking Send,
      • Finding draft ticket replies

        Is there a way to see all tickets which have draft replies?
      • Guidance on Making Zoho Desk Connections Available for All Data Centers

        Hi Team, I’m currently developing an application using Zoho Desk connections to manage OAuth for my third-party products. Could you please advise on the steps required to make it available across all data centers? Looking forward to your thoughts on
      • Caso de Uso | Menos trámites, más salud: Clínicum optimiza sus recursos con Zoho One

        "La automatización del proceso de solicitud de bajas y su trazabilidad a través de Zoho nos ha supuesto una mejora en el ROI." - Carol Rodríguez, Responsable de Experiencia del Cliente interno y externo en Clínicum ¡Hola a todos! Estamos emocionados de
      • Is it possible to disable Chat Waiting Time, or to make it indefinite?

        We have used many online chat services over the years. However, Zoho's SalesIQ appears to be the only one we've tried that has a mandatory time limit where we must respond to new customer queries. We are a small business so we have no dedicated staff to monitor incoming chats, which makes this requirement very undesirable. (There have been no complaints from our clients when we're slower to follow up.) Is there an option I'm missing to turn Chat Waiting Time off, or to allow an infinite wait time?
      • Double opt-in notifications and customizable confirmation messages for your webforms

        Dear CRM Community, We are excited to announce a major upgrade to our Webforms feature. You can now customize the confirmation message shown to your users who double opt-in from your webform and also customize your confirmation emails when they submit
      • Something went wrong. One or more fields contain errors

        I am getting this error but there is no way to debug what field is causing the issue . I have over 100 fields. Everything was working fine and then i fixed some fields that should have the same field names but had a typo and i am getting this error. It
      • Bulk create tasks - Zoho Projects API

        Hi Zoho/Community, I am trying to create multiple tasks in a single API call, is there a way we can combine multiple request bodies into one single payload? The issue I am facing is the rate limiting on the API, I wanted to create certain amount of tasks
      • Task Due dates and Reminder Date & Time

        I like to have a reminder on many tasks in Zoho Recruit. I find the process cumbersome in that each task requires the following: 1. click and select due date 2. Click the reminder box 3. Click on (Reminder) Start Date 4. Click on (Reminder )Time If one
      • Unable to Access Admin Console and Email Sending Issues

        Hello Zoho Support Team and Community, I hope this post finds you well. I am currently facing two significant issues with Zoho services: Admin Console Access Issue: Every time I try to access the Zoho Admin Console, it gets stuck on the loading screen
      • Next Page