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

    • DYK 14: Create Tasks with AI

      Did you know AI can suggest tasks within your Zoho Projects portal? Breaking a project into clear, actionable work items takes time and manual effort. Especially when the same team handles both planning and execution. AI task suggestions in Zoho Projects
    • #11 Nithya's First Overseas Client

      Nithya designs for clients in three countries and has never met any of them. Her first overseas invoice took a full evening. The second took four minutes. The difference was not a clever tax trick. She stopped treating every international customer as
    • Other languages in Schedulers (Zoho Books)

      Hello everyone, currently we have create functions in other languages, like nodejs etc but on schedulers we can use only deluge.. Are other languages on schedulers roll out? Kind regards, Sakis Oikonomou
    • New in Office Integrator: Extract data from images into your spreadsheet

      Hi users, We are pleased to introduce the Data from Picture feature in Zoho Office Integrator's spreadsheet editor. It intelligently detects and organizes text and numbers from any image into structured cells using OCR. With this feature, users can turn
    • Edit PDFs using Zoho PDF Editor

      Hello users, In a previous article, we covered the organizing capabilities of Zoho PDF Editor. Here, we'll provide a quick recap of its editing features, including a few new additions. A few highlights of Zoho PDF Editor's editing capabilities: Add and
    • Partner with HDFC And Sbi Bank.

      Hdfc and sbi both are very popular bank if zoho books become partner with this banks then many of the zoho books users will benefit premium features of partnered banks.
    • Multiple subscription plan line items in Zoho Billing quotes

      I run an IT company and sell a lot of licences. A client might have multiple subscription plans including software licences in different categories. A client might have Microsoft licences, antivirus licences, web hosting and maintenance package services.
    • Mail Merge templates in Sandbox

      Rolled out for all DCs Hello everyone, You can now create and test Mail Merge templates directly in Sandbox, making it easier to validate document generation without affecting your live organization. Why this matters Mail Merge templates are often used
    • Zoho Books | Product updates | October 2026

      Hello users, October brings a range of new features and enhancements to Zoho Books, designed to simplify compliance, streamline accounting workflows, and improve inventory management. From the launch of the Nigeria Edition and France’s e-invoicing capabilities
    • Dashboard Table of “My New Work Orders” Changes View

      Hi FSM Team, We noticed an inconsistency with the Dashboard Table of “My New Work Orders.” Initially, the table is configured to use the “My New Work Orders” view. When we go to the Home page, the table displays a different set of records. When we return
    • Tips & Tricks #6 | Zoho Vault: Audita actividad, Gestiona accesos, Comparte credenciales & mucho más.

      ¿Sabías que Zoho Vault puede hacer mucho más por la seguridad de tu equipo? Las contraseñas forman parte del día a día de cualquier persona y organización. Aplicaciones, herramientas internas, cuentas de clientes, servicios externos, plataformas de marketing,
    • Inquiry Regarding Customer Hierarchy & Sub-Customer Creation via Zoho API

      Dear Zoho Support Team, Our mutual client has requested support for implementing the Customer Hierarchy (Parent/Sub-Customer structure) within our existing workflow. At the moment, all invoices are being created in Zoho under the main (parent) customer
    • Which Zoho CRM tasks would you want an AI assistant to handle?

      I’ve started delegating my Zoho CRM work to AI – and many tasks now take me half the time. It has been so useful that we’re now working to make it available to everyone. Instead of clicking through records and tabs, I simply describe what needs to be
    • Introducing MCP for Zoho CommunitySpaces

      Hello everyone, Your AI assistant can now share the community workload with you. Zoho CommunitySpaces supports MCP (Model Context Protocol), so you can link an AI assistant like Claude, ChatGPT, or Cursor to your community and run it through plain language
    • CV-Library: The Newest Source Booster in Zoho Recruit!

      We’ve expanded your sourcing toolkit — CV-Library, one of the UK’s largest and most trusted online job boards, is now available as a Source Booster in Zoho Recruit. This gives recruiters instant access to millions of UK-based candidate profiles, all without
    • Tip 52#: Ways to improve data flexibility using related list

      A related list offers an ideal solution to string related data across entities together. It enables you to pull records from any module or external source and float them as a tab within your project, sprint, epic, work item, or release detail view layout.
    • Search is completely broken for PC

      I go to note, try to search for "mtga" and it shows 702 results (it's a big note), highlights all letters "m" and I can't find anything. Same for "gathering" - it thinkgs I think only for "g". Looking for "zoho" shows as if I searched only for "z". Using
    • Email Blast

      Hi, How do we send an email blast to thousands of customers? The email addresses are not yet saved in Zoho Desk.
    • Zoho ERP | Product updates | September 2026

      Hello users, A new month, a fresh set of updates in Zoho ERP. This month brings Netting, enhancements across our verticals, and more updates to help streamline your everyday work. Explore this month’s updates and see what’s new. Introducing Netting If
    • Introducing Zoho POS for Restaurants

      Hello Community, We’re thrilled to announce the launch of Zoho POS for Restaurants, unveiled at the 30th milestone edition of Zoholics India 2026. Running a restaurant involves multiple teams and workflows. A single table journey, from seating a guest
    • WhatsApp Business Message Pricing Update: Effective October 1, 2026

      Hi everyone, Starting October 1, 2026, Meta is updating how WhatsApp Business messages are charged. This guide explains the new per-message pricing model, how message categories work, and what changes for service messages specifically. How Meta charges
    • Zoho Calendar integration for Bigin

      Hello everyone, We're excited to introduce Zoho Calendar's integration in Bigin! For a while now, users have been able to sync events in Bigin with Google Calendar and Outlook Calendar - but with this new topping, it syncs with Zoho Calendar as well.
    • Does Updating Employee Names and Profile Pictures in Zoho One Automatically Sync Across All Zoho Applications?

      Hi Zoho Team, We are currently using Zoho One in our organization and want to centrally manage employee profile information. As a Zoho One Super Admin, if I update the employee name and profile picture for all users from the Zoho One Admin Panel, will
    • Enhanced shared mailboxes: Dedicated Sent folders, Run-through filters & fresh UI

      Hi everyone, Collaborative communication is the backbone of smooth operations; whether you are handling customer support queries, managing vendor requests, or tracking sales leads. Shared mailboxes in Zoho Mail ensure your team stays on the same page
    • How to Manage Two GST Numbers / Two Companies in a Single Zoho Inventory Organization?

      Hi Team, We currently have two separate legal entities: A Proprietorship Firm with its own GSTIN A Private Limited Company with a different GSTIN However, operationally, both companies deal with the same products, and we would like to manage the physical
    • 10/22 15時〜 オンラインもくもく会のお知らせ | Zoho ワークアウト

      ユーザーの皆さま、こんにちは。コミュニティグループの中野です。 10月22日(木)開催の「Zoho ワークアウト」をご案内します。 Zoho ワークアウトは、参加者それぞれが取り組みたいテーマを持ち寄り、ユーザー同士で交流しながら、 設定・検証・運用改善を進めるオンラインの「もくもく会」です。 「試してみたい設定があるけれど、なかなか時間を取れない」 「一人で進めていると、途中で手が止まってしまう」 「他のユーザーの活用方法や工夫を聞いてみたい」 そんな方は、Zoho ワークアウトで一緒に取り組んでみませんか?
    • Reporting tags associated to Project in Zoho books?

      Hi, I know you can add reporting tags to contact, articles and transactions. Is it possible to add reporting tags to Project. We Zoho reports I would be able to generate reports by tags. Sometimes tags for a contact is different for projects (ie Projects
    • Reporting Tags in Profit and Loss Reports Analysis

      Hello Community and Zoho Books Product Team, I would like to highlight a limitation I encountered with Reporting Tags in Zoho Books. Reporting Tags Not Applying to Automated Inventory Journal Postings from Product Invoices. For inventory product invoices,
    • Spam Quarantine: Manage suspicious emails in Zoho Mail

      When an email is quarantined by spam processing, it need not always be blocked right away. Some emails may be marked incorrectly, or may need to be reviewed before a final decision is made. The Spam Quarantine feature in the Zoho Mail Admin Console gives
    • What is the difference between "Reply" and "Public Comment" in a ticket?

      Hey, my company is thinking about switching to Zoho Desk but we do not understand the difference between the "Reply" and the "Public Comment" feature. When should we use which? And why? What is the difference between them? Thank you for your help! Kindest
    • Comments Vs. Replies

      I'm curious as to the difference between a "Reply" and a "Comment" on a ticket. It appears that "Replies" are what's used to determine response time SLA's and there are also used to automatically re-open tickets. I'm just trying to understand the key differences so I can educate both our clientele and our back-end users on which function/feature to use to better improve the ticket lifecycle. If anyone has any insight it would be appreciated. Thanks!
    • What's New in Zoho Inventory | July & August 2026

      Hello users, The July and August 2026 releases bring a range of new features and improvements across the product. From the Nigeria Edition and Super Admin enhancements to Sri Lanka IRD-compliant invoicing, Loyalty Program Management, and improvements
    • Forms data export bug

      The export csv with a password has changed for the worst. It is less secure by not allowing complex passwords. Just last week and the last year (at least) I was able to use a complex, secure password. Export CSV moreover doesn't even work if I use a simple
    • Fax and email questions

      Does Zoho offer faxing capability? If so, how to do it? And, why is has my email inbox stopped in 2019? There are no more emails since then. Also if I delete all of those emails, will they delete it from my gmail account (I'm linked to a gmail email address).
    • Create a single record from multiple images with ICR

      Hello all, Zia's Intelligent Character Recognition can now create a single record from multiple images based on the configured ICR rule. Users can upload up to three images at once, such as an ID, a passport, and a business card, and Zia will extract
    • How to present an Analytic on a CRM dashboard and filter it on loginuser id

      How to present an Analytic on a CRM dashboard and filter it on loginuser id? I want to display an Analytics pivot table (as a widget) on a CRM dashboard and have the pivot filtered on the loginuser. I want additional user-filters available, such as date,
    • CNIL - Suivi de Pixel

      Bonjour à tous, À la suite de la nouvelle recommandation de la CNIL sur les pixels de suivi dans les e-mails, savez-vous si Zoho Campaigns permet : de conditionner le suivi des ouvertures au consentement de chaque contact ; de proposer un lien permettant
    • Setting default From address when replying to request

      At the moment, if I want to reply to a request, the From field has three options, company@zohosupport.com, support@company.zohosupport.com, and support@company.com. The first two are really internal address that should never be seen by the customer and
    • Zoho Payroll: Product Updates - Q3, FY2026

      Over the past quarter, Zoho Payroll has added several updates to make payroll easier to process, configure, and manage. The most notable improvements cover bank integrations, reimbursement support, payslip enhancements, employee exit documentation, payroll
    • Convert OLM to PST on Mac and Windows Using Free Methods

      When your Outlook for Mac data is stored in an OLM file and you want to use it with Outlook for Windows, the simplest approach to transfer your emails and other mailbox information is to convert the OLM file to a PST file. OLM is primarily associated
    • Next Page