Associate CRM Products with Zoho Desk Contacts and Accounts Automatically

Contacts and Products Association from Zoho CRM to Zoho Desk

Summary:


By default, the Zoho CRM–Zoho Desk integration only syncs
Contacts, Accounts, and Products as standalone modules. However, the associations between Products and Contacts/Accounts are not preserved during the sync. This article explains a custom workaround using workflows and Deluge functions to bridge this gap and ensure product associations are reflected in Zoho Desk.

For example, let’s say there are two contacts associated with a product in a Zoho CRM instance. When the integration is set up, both the contacts and the product will be synced to Zoho Desk. However, the synced product will not be automatically associated with the synced contacts in Zoho Desk.

Solution: Associate Products to CRM Contacts in Zoho Desk:

Whenever a product is associated with a contact in Zoho CRM, you can configure an automation in CRM to establish the same association in Zoho Desk.

Steps Overview:
  1. Create a Workflow Rule in Zoho CRM that triggers whenever a product is associated with a contact or account.
  2. Add a Custom Function as the workflow action.
  3. In the custom function,
    • Identify the corresponding synced Contact and Product records in Zoho Desk using their unique identifiers (for example, email address or product name).
    • Invoke the Zoho Desk “Association” API to create the relationship between the contact/account and the product.
This ensures that any association made in Zoho CRM is automatically reflected in Zoho Desk, maintaining data consistency across both applications.


Step 1:  Add a Checkbox field in Zoho CRM

In Zoho CRM, add a checkbox field (for example, Sync_to_Desk) in the Contacts module.

If you’re wondering why this field is required, please note that currently, it is not possible to configure an automation that triggers automatically when a product is associated with an account or contact from the Products related list.

As a workaround, after associating the products, users will need to manually select the checkbox to initiate the automation.

In this case, the checkbox acts as a trigger, when selected, it executes the workflow rule and subsequently runs the custom function to sync and associate the records in
Zoho Desk.


Step 2 : Create a workflow in Zoho CRM that triggers on the checkbox field:

Set up a Workflow Rule in Zoho CRM that triggers when the checkbox field (for example, Sync_to_Desk) is selected.

After associating a product with a contact or account, users must manually select this checkbox to initiate the automation. The workflow will then execute the configured custom function to identify and associate the corresponding records in Zoho Desk.

Workflow Setup
  1. Navigate to Setup → Automation → Workflow Rules.
  2. Click Create Rule, select the appropriate module (Contacts or Accounts), and provide a name and description for the rule.
  3. Under When to trigger, choose On a record actionEdit.
  4. In Condition, specify:
    Sync_to_Desk = True
  5. Under Instant Actions, choose Function and associate the custom function shared below (which calls the Zoho Desk Association API).
  6. Save and activate the workflow.
This ensures that every time the checkbox is selected, the association between the synced product and contact/account in Zoho Desk is automatically created.

Screenshot for reference:



Code:

  1. DESK_ORG_ID="769696778";
  2. associatedProducts = zoho.crm.getRelatedRecords("Products","Contacts",contactId);
  3. searchValue = {"email":CRM_CONTACT_EMAIL};
  4. // info searchValue;

  5. deskContacts = zoho.desk.searchRecords(DESK_ORG_ID,"contacts",searchValue,0,10);
  6. //info deskContacts;

  7. matchingContactId = "";
  8. for each  contact in deskContacts.get("data")
  9. { if(ifnull(contact.get("zohoCRMContact").get("id"),"") == contactId)
  10. {
  11. matchingContactId = contact.getJSON("id");
  12. break; 
  13. }
  14. }
  15. info matchingContactId;

  16. if(matchingContactId.isNull() == false)
  17. {
  18. for each  product in associatedProducts
  19. {
  20. productName = product.get("Product_Name");
  21. searchValue = {"productName":productName};
  22. matchingProducts= zoho.desk.searchRecords(DESK_ORG_ID,"products",searchValue,0,5,"desk");
  23. productId = matchingProducts.getJSON("data").get(0).get("id");

  24. mp = Map();
  25. mp.put("ids",{matchingContactId});
  26. mp.put("associate",true);

  27. associateContactWithTheProduct = invokeurl
  28. [
  29. url :"https://desk.zoho.com/api/v1/products/" + productId + "/associateContacts"
  30. type :POST
  31. parameters:mp.toString()
  32. connection:"desk
  33. ];
  34. info associateContactWithTheProduct;
  35. }
  36. }

Explanation of the script:

  1. Fetch related products – Retrieves the list of products associated with a specific contact.
  2. Identify the contact – Locates the matching contact in Zoho Desk using a unique identifier (such as the email address).
  3. Associate products – Iterates through all the fetched products and uses the "Associate contacts with products" API to link each product with the identified contact in Zoho Desk.

Screenshot for reference
:





NotesNotes: Refer to the following Guide - Article to learn the best practices for Optimizing the code and various ways to deploy Custom Function across Zoho CRM.
Custom Solution Created by Yogeshwari N | Zoho Partner Support

If you need any further clarifications, please don’t hesitate to contact 
partner-support@zohocorp.com.

Additionally, we kindly ask all Europe and UK Partners to reach out to partner-support@eu.zohocorp.com.







        Create. Review. Publish.

        Write, edit, collaborate on, and publish documents to different content management platforms.

        Get Started Now


          Access your files securely from anywhere

            Zoho CRM Training Programs

            Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.

            Zoho CRM Training
              Redefine the way you work
              with Zoho Workplace

                Zoho DataPrep Personalized Demo

                If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.

                Zoho CRM Training

                  Create, share, and deliver

                  beautiful slides from anywhere.

                  Get Started Now


                    Zoho Sign now offers specialized one-on-one training for both administrators and developers.

                    BOOK A SESSION







                                Quick LinksWorkflow AutomationData Collection
                                Web FormsEnterpriseOnline Data Collection Tool
                                Embeddable FormsBankingBegin Data Collection
                                Interactive FormsWorkplaceData Collection App
                                CRM FormsCustomer ServiceAccessible Forms
                                Digital FormsMarketingForms for Small Business
                                HTML FormsEducationForms for Enterprise
                                Contact FormsE-commerceForms for any business
                                Lead Generation FormsHealthcareForms for Startups
                                Wordpress FormsCustomer onboardingForms for Small Business
                                No Code FormsConstructionRSVP tool for holidays
                                Free FormsTravelFeatures for Order Forms
                                Prefill FormsNon-Profit

                                Intake FormsLegal
                                Mobile App
                                Form DesignerHR
                                Mobile Forms
                                Card FormsFoodOffline Forms
                                Assign FormsPhotographyMobile Forms Features
                                Translate FormsReal EstateKiosk in Mobile Forms
                                Electronic Forms
                                Drag & drop form builder

                                Notification Emails for FormsAlternativesSecurity & Compliance
                                Holiday FormsGoogle Forms alternative GDPR
                                Form to PDFJotform alternativeHIPAA Forms
                                Email FormsFormstack alternativeEncrypted Forms

                                Wufoo alternativeSecure Forms

                                TypeformWCAG


                                    All-in-one knowledge management and training platform for your employees and customers.

                                              Create. Review. Publish.

                                              Write, edit, collaborate on, and publish documents to different content management platforms.

                                              Get Started Now




                                                                You are currently viewing the help pages of Qntrl’s earlier version. Click here to view our latest version—Qntrl 3.0's help articles.




                                                                    Manage your brands on social media


                                                                      • Desk Community Learning Series


                                                                      • Digest


                                                                      • Functions


                                                                      • Meetups


                                                                      • Kbase


                                                                      • Resources


                                                                      • Glossary


                                                                      • Desk Marketplace


                                                                      • MVP Corner


                                                                      • Word of the Day


                                                                      • Ask the Experts


                                                                        Zoho Sheet Resources

                                                                         

                                                                            Zoho Forms Resources


                                                                              Secure your business
                                                                              communication with Zoho Mail


                                                                              Mail on the move with
                                                                              Zoho Mail mobile application

                                                                                Stay on top of your schedule
                                                                                at all times


                                                                                Carry your calendar with you
                                                                                Anytime, anywhere




                                                                                      Zoho Sign Resources

                                                                                        Sign, Paperless!

                                                                                        Sign and send business documents on the go!

                                                                                        Get Started Now




                                                                                                Zoho TeamInbox Resources





                                                                                                          Zoho DataPrep Demo

                                                                                                          Get a personalized demo or POC

                                                                                                          REGISTER NOW


                                                                                                            Design. Discuss. Deliver.

                                                                                                            Create visually engaging stories with Zoho Show.

                                                                                                            Get Started Now








                                                                                                                                  Wherever you are is as good as
                                                                                                                                  your workplace

                                                                                                                                    Resources

                                                                                                                                    Videos

                                                                                                                                    Watch comprehensive videos on features and other important topics that will help you master Zoho CRM.



                                                                                                                                    eBooks

                                                                                                                                    Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho CRM.



                                                                                                                                    Webinars

                                                                                                                                    Sign up for our webinars and learn the Zoho CRM basics, from customization to sales force automation and more.



                                                                                                                                    CRM Tips

                                                                                                                                    Make the most of Zoho CRM with these useful tips.



                                                                                                                                      Zoho Show Resources