Custom script for improved Desk integration

Custom script for improved Desk integration

Good afternoon,

I ended up undertaking a development project to achieve the goal outlined below. I've summarised the project below and attached a PDF copy which covers each stage of the project from end-to-end, this may or may not be of interest to members undertaking dev work in their own Zoho CRM and Desk environments.

First and foremost, the goal:

When we manually create a new Account in Zoho CRM, a Primary contact will be added and then sometimes a Secondary contact, however once the customer is onboarded and services deployed, they can then contact our support desk for assistance and problem reporting... in many cases, the Primary and Secondary Account contact/email do not end up being the people submitting tickets and in all cases they are never the only people to submit tickets.

The native Zoho CRM <> Zoho Desk integration only supports the association of Tickets to accounts by the Primary Email or the Secondary Email, this resulted in a vast swathe of our support desk tickets never being associated to Accounts and nor would future tickets be whenever they were not submitted by a Primary or Secondary contact and so I had to find and implement a fix for this.

And that is where this journey started, I encountered limitations and/or problems at pretty much every step along the way that tested my patience but the perseverence paid off; this automation is now fully operational and working as desired within our CRM and Desk environments and the results are exactly what I was hoping for.

Initial Identified Problems:

1. Automation to create a new Contact and assign it to a correct Account required a different approach and the obvious option was to have this done by matching the email domain from which the Contact has sent an email to our Desk to a custom Email Domain field that we have created and made mandatory in the Accounts layout on CRM (screenshot of field provided under Function 2 within the attached PDF).

This allows our system to automatically capture and associate all Contacts to correct Accounts using a customer's email domain rather than a specific email address and therefore taking away the reliance of the person contacting having to already be saved in our CRM as a Primary or Secondary email on a CRM Account.

2. Next up, it was apparent that automatic Contact creation by Zoho Desk INTO Zoho CRM was not triggering which meant the process was failing at the first hurdle.

2a. What I did notice as I done some more digging... When I opened any new Contact in the desk it became clear that the entire name of the person was being extracted correctly but then auto-filled into the LAST NAME field only with the First Name field left completely blank.

I then manually extracted the first name from the last name field of one Contact and pasted it into the first name field... voila... the Contact then appeared in the CRM instantaneously, I repeated this on a couple more contacts with the same end result.

I then embarked on the below project consisting of a series of custom functions and workflows both Desk-side and CRM-side to create a pipeline of functions that would address the Contact association to Account in CRM, then push the accountId back to the Desk Contact and Ticket which would then result in the Ticket being associated to the Account and thus displaying in the Zoho Desk module within the Accounts view in Zoho CRM with the added benefit of all of the Contact's contact details listed against the Contact in the Ticket view.

Pretty much every step seemed to have a limitation or issue thus requiring a custom function so that each task would be automatically completed in full allowing the next automated step of the process to trigger and that's why I thought I would share this in the community, the attached PDF contains the Workflow Rules, Argument Mapping and Script utilised for each custom function that make up the entire process and therefore individual functions may be of interest or value to some rather than the whole project.

Additionally, if anybody finds themselves in the same/similar predicament and wanting to achieve the same goal then this provides a full start-to-finish pathway for them to achieve the functionality.

Please note that some Scripts are standalone and not part of a Workflow Rule


The Project and Pipeline of Events/Functions is as follows:

1. Customer sends email to our Zoho Desk, this can be any person from the customer's company that is or is not already a listed contact within our CRM.

2. Desk auto-creates a Contact if it doesn't already exist, placing the person's full name in the Last Name field only. (Problem).

3. Workflow with custom function fires on create, custom function extracts First Name from Last Name field, and populates First Name field with the extracted First Name from the Contact (Problem resolved).

4. Desk-to-CRM native sync is now working and syncs the contact to our CRM.

5. CRM workflow then fires on creation of the new Contact, matches the Contact's EMAIL DOMAIN (not the full email) to the correct Account by referencing a custom Email Domain field that I have created within the Accounts Module/Layout (screenshot included in PDF) - This means that the contact does not have to be already listed in the CRM as any new Contact will be added and associated to the correct Account via the custom function matching the Email Domain, e.g. customerdomain.net, instead of name@customerdomain.net.

6. CRM contact is then associated to the correct Account automatically.

7. CRM function also updates the Contact in Zoho Desk with the correct accountId directly via API.

8. Desk Workflow then fires on Ticket create and sets the same accountId on the Ticket via the domain matching - This accountId function is to trigger every time a ticket is created regardless of whether the Contact is newly created or already existing therefore capturing all new tickets.

9. Ticket now visible in Desk Module in the CRM Account too. RESULT!

All of this now achieved without having to rely on Primary or Secondary email as per the native sync.

The attached .pdf covers the project from start to finish, including the scripts implemented for each custom function so you can copy, paste and then simply update the Org ID and email address to your own, please be aware Org ID and email addresses can appear more than once in some of the scripts.

Please note, our Org ID and my Email Address has been partially redacted to protect the information but still presented in a way that clearly indicates how they are entered within the scripts.

Additional note, within the PDF there are a couple of Backfill sections and scripts where I had to create a custom function in the CRM to manually trigger to run through existing Contacts identify those unassociated to any Account then asssociate them to the correct Account.

There was also a Backfill function set up also to manually run and sweep existing tickets to Associate those to correct accountIds too thus ensuring that any submitted prior to this Automation project would also be associated to the correct Accounts.

I hope this helps... I had a big sense of achievement when I successfully completed this journey on Tuesday and saw the functionality happening live and correctly.
    • Recent Topics

    • Add ZeptoMail to Zoho One

      Hi Zoho Team, I would like to request that ZeptoMail be added as a fully included application within Zoho One. Why this is important Zoho One is positioned as a unified business operating system that brings the applications an organization needs under
    • GETTING THERE THANKS

      So we are still testing thanks to the great Zoho team for firstly getting pricelists working (essential) and writing some code to hide delivery and pickup options. Brilliant. So price lists are a definite mainly because of VAT. We run our Zoho books with
    • Time Zone is incorrect

      Time zone is not working properly...I've checked it twice. I'm eastern U.S. time it's currently 12:22 pm EST. CRM shows 3:22 pm EST.
    • CRM wants to access other apps and services on this device (Documents area)

      Did anyone else see this today? It only seemed to popup in the Documents area. Blocking it did not stop the ability to upload files there... Why is this coming up and what apps/services is it requesting in the background? Also, is it applicable elsewhere
    • Custom module - change from autonumber to name

      I fear I know the answer to this already, but thought I'd ask the question. I created a custom module and instead of having a name as being the primary field, I changed it to an auto-number. I didn't realise that all searches would only show this reference.
    • How can I populate dropdown data with information from another source or app?

      I want to maintain a list of items in another app (say in excel or another database) and sync those as items in a drop down menu, instead of copy pasting to import. Is this kind of a feature available?
    • Dynamic Field Folders in OneDrive

      Hi, With the 2 options today we have either a Dynamic Parent Folder and lots of attachments all in that one folder with only the ability to set the file name (Which is also not incremented so if I upload 5 photos to one field they are all named the same
    • Zoho Tables is now available in Zoho One!

      Hello Zoho One users, We’re excited to announce that Zoho Tables is now included as a part of Zoho One suite! As teams grow, managing projects, approvals, inventories, campaign trackers, and operational workflows across multiple spreadsheets become difficult.
    • Getting there -thanks

      So we are still testing thanks to the great Zoho team for firstly getting pricelists working (essential) and writing some code to hide delivery and pickup options. Brilliant. So price lists are a definite mainly because of VAT. We run our Zoho books with
    • Automatically remove commas

      Team, Please be consistent in Zoho Books. In Payments, you have commas here: But when we copy and paste the amount in the Payments Made field, it does not accept it because the default setting is no commas. Please have Zoho Books remove commas autom
    • #3 Making it look like my business

      Day 3: Meera had created her first invoice. The numbers were right, but something still felt unfinished. Her studio name was there, but the address did not look the way she wanted. Her logo was missing, and the invoice did not really feel like it came
    • Zoho Books - France

      L’équipe de Zoho France reçoit régulièrement des questions sur la conformité de ses applications de finances (Zoho Books/ Zoho Invoice) pour le marché français. Voici quelques points pour clarifier la question : Zoho Books est un logiciel de comptabilité
    • Scan & Fill with double quote key/value pairs

      Hi, An old Ticket moved to a Topic/Idea: I love the idea of the new Scan & Fill as it nearly covers my previous request for a QR Scanner to read a multi-part QR Code. My QR Codes are hard-coded as below: {"key1":"value1","key2":"value2","key3":"value3"}
    • Increase the "Maximum Saved Entries per User" Options Limit

      Hi, You can create lots of saved entries, yet the Limit when you apply one is 25, we may often expect 32 to be in draft, and therefore want to enforce that, can we increase the limit of this field from 25 to 100 (As you can just turn it off and have more
    • HEIC File Type Viewer

      Hi, It would be nice to be able to click on the images in the All Entries/Reports Tables which are HEIC the same as JPG, PNG, etc. so they open in a viewer from Zoho or the Attachment Service, today HEIC requires you to download each image and open it
    • Map Dependency Upgrades in Zoho CRM

      Map Dependency Fields enhancements are now available across all DCs. Hello everyone, We’ve introduced a set of enhancements to Map Dependency Fields to make setup simpler, faster, and more intuitive. Map Dependency helps control how values appear across
    • Specific ListView Canvas on Canvas Home Page Always Loads Most Recent ListView, Not the One Specified

      I had mentioned this to ZOHO, but I mainly wanted to see if others in the Community are also facing this problem. I created a Canvas ListView for a Custom Module, and then created a Canvas Home page (technically on a tab item, but I'm not sure if that
    • Programmatic Itemized Expenses?

      It does not appear that it is possible to create itemized expenses programmatically (via the API)? Is this correct, or am I misunderstanding the situation?
    • Zoho Forms Submission URL

      Hi Zoho, It would be great to have a URL which can take us to specific form entries. For example: https://forms.zoho.eu/ACCOUNTNAME/report/FORMNAME/records/UNIQUE-REF I currently have a use case where I want to use Zoho Flow to create a module entry in
    • Optional Parameter in Deluge Sendmail function to link email to record

      I love sendmail - it offers flexibility (and, with standalone functions, commonality with minimal maintenance) over the years the templates hadn't offered. I understand the templates have come a long way, but I still prefer sendmail most days. That said...
    • Zoho CRM Functions: Redesigned Interface, Rich Analytics, and Multi-Language Support

      Hello everyone! We have given Functions in Zoho CRM a major overhaul with a new interface that makes it easier to build, organize, monitor, and troubleshoot your functions throughout their lifecycle. As part of this revamp, we have also introduced a unified
    • 📣 And the Bigin Customer Award winners are...

      50+ entries. Customers from across the globe. So many great Bigin stories. And now, it's time to celebrate the people who stood out. We launched the Bigin Customer Awards to see how businesses are using Bigin in their own unique ways, and you did not
    • Report Configuration - Unable to select "File_Upload" under Supporting Document

      Good day everyone. I encounter this issue whereby i have difficulty to select "File_Upload" under Supporting Document when i configuring my report. Ps: I have create Supporting Document in Zoho creator form as subform and the add this "File Upload" inside
    • Zoho CRM Multi-select values not translated

      Hello! I have some issue with translate custom multi-select fields in zoho CRM in other language. I download export file, but it has all my custom fields and picklist values exept multi-select fields picklist values.  Please, help me to undestand, is
    • Go Multilingual with Instant Bot Auto-Translation

      Imagine you run a travel company with customers across different regions. Your website chatbot helps visitors discover travel packages, answers questions, and makes bookings. As your business expands into new markets, you want to offer the same experience
    • Create Flexible Layouts with Layout Rules

      In a project, when a work moves from planning to execution, the information teams need can change at every stage. A project can need one set of details, a phase can need another, and a custom process may require an entirely different set of information.
    • Introducing Incentives for Zoho CRM: Build, automate, and track sales commissions

      Dear Customers, We are here with an amazing news! We built a direct solution to help manage your commission provisioning activity in your business. From creating commission plans to issuing payouts, this application leverages your sales reps’ performance
    • Zoho Sites after login page blank

      after i login to zoho sites, it stalls at a blank screen please help
    • Map My Client Locations for Zoho CRM Extension: Turn CRM Addresses Into Action

      Hello everyone, Your CRM knows who your customers are. Now, see where they are on the interactive map directly from Zoho CRM. Introducing Map My Client Locations for Zoho CRM, an extension built for businesses that rely on sales visits, field service,
    • Find the conversions hiding outside your funnel: User Journeys is now live in PageSense

      Hello Everyone, We are excited to announce that User Journeys is now live in Zoho PageSense. Here is what that means for you. Funnels are great for one thing. They tell you how the path you designed is performing. Homepage to product to cart to checkout,
    • Zoho CRM Error message #2 : Fixing [Invalid Credentials] and [Authentication Fail] while configuring IMAP

      Hi Everyone! As a part of our Zoho CRM Error messages series, we're going to focus on couple of error messages that you might encounter while configuring IMAP and ways to resolve them. These are: [Invalid Credentials] [Authentication Fail] The annoying
    • Zoho Community Digest - August 2026 | Part 4

      Hi everyone, and welcome back! We're closing out August with a strong final week, from Incentives for Zoho CRM bringing commission management inside the platform to Sequences in Bigin automating customer follow-ups end to end. There's also an IP allowlist
    • Related Lists: Consolidate cross-module data

      A new and efficient way to connect your project data across the boundaries of modules, entities, and applications. Introducing related lists to incorporate related records from any module, entity, or external source directly into the detail view of a
    • Zoho Workshops in Frankfurt a.M. | 07. & 08. Oktober 2026 | Nur noch 1 Monat

      Liebe deutschsprachige Zoho Community, Nur noch einen Monat bis zu den Zoho Workshops in Frankfurt! Am 7. und 8. Oktober ist es soweit: Die Zoho Workshops kehren zurück und finden dieses Mal im Radisson Blu Hotel, Frankfurt am Main, statt. Wenn Sie Ihre
    • Billing Status and WO Status Field Colors -

      Hello Team, I noticed that the colors of the Billing Status and WO Status fields in the WO module have been changed. (Org ID:170000078905) This is not urgent to correct, but I wanted to bring it to your attention so you can check whether this is a system
    • Need to set workflow or journey wait time (time delay) in minutes, not hours

      Minimum wait time for both Campaigns workflows and Marketing Automation journeys is one hour. I need one or the other to be set to several minutes (fraction of the hour). I tried to solve this by entering a fraction but the wait time data type is an integer
    • Zoho Assist Remote Desktop on Android grey screen

      With Zoho Assist Remote Desktop for Android when I connect to an unattended device I see only a Grey Screen. It worked fine before. This is a recently issue. I tried to clean data and cache, reinstall app, try and old version... but nothing. Always grey
    • Integration Multiple WooCommerce Stores

      Currently, Zoho Marketing Automation supports connecting only one WooCommerce store per account. For businesses managing multiple brands or stores, this creates operational challenges, as they are forced to maintain separate accounts for each store. Suggested
    • Introducing Smart Fields in Zoho Forms

      Hello form builders! We are excited to introduce Smart Fields in Zoho Forms - a faster way to add calculations to your forms without writing formulas. Instead of creating multiple fields and configuring complex calculations yourself, you can now drag
    • Feature Request: Add Sort by Cell Color and Text Color functionality

      Hello Zoho Sheet Development Team, I am writing to suggest a feature enhancement for Zoho Sheet. Currently, the platform supports "Filter by Color," which is incredibly useful. However, there is no native option to "Sort by Color" (by cell fill or text
    • Next Page