How to Update Multi-Select Lookup Fields via API in Zoho CRM

Update Multi-Select Lookup Fields via API in Zoho CRM - Establish many-to-many relationships using linking modules or REST API

Overview: 

Multi-Select Lookup Field in Zoho CRM allows you to establish a many-to-many relationship between two modules. This is useful when a record in one module can be linked to multiple records in another, and vice versa.

Business Example:

Let’s say your business deals with training services. You have a Trainers module and a Courses module. Each trainer can handle multiple courses, and each course can be conducted by multiple trainers. In such a case, a multi-select lookup field between Trainers and Courses allows you to easily manage and view these relationships from either module.

InfoTo learn more about Multi-Select Lookup Fields, refer to this document.

Understanding Multi-Select Lookup Field Functionality:

When a multi-select lookup field is added to a module, a corresponding multi-select lookup field is automatically created in the referenced (looked-up) module, enabling a bidirectional relationship.

Example:

If you add a multi-select lookup field for the Courses module in the Trainers module:
  • A field named Trainers will automatically be created in the Courses module.
  • If you associate Courses X, Y, and Z with Trainer A, then:

    • Trainer A will show Courses X, Y, Z in its multi-select field.
    • Course X will also display Trainer A in its corresponding multi-select lookup field.

Screenshots

  

 

Linking module:

While creating a multi-select lookup field, you also have the option to enable a Linking ModuleThe Linking Module stores the relationships between records as individual entries, helping preserve and reference the connections explicitly.



Continuing with the above example:


Linking record
        Relationship
                    Record 1

                                   Course
 X ↔ Trainer A
                      Record 2
                                   Course Y ↔ Trainer A
                      Record 3
                                   Course Z ↔ Trainer A

Screenshots







Why update Multi-Select Lookup Fields via API?

While users can manually associate records via the CRM UI, programatically updating multi-select lookup fields using API offers significant advantages:

  • Bulk Association: Easily associate multiple records in one go, especially useful for migrations or mass updates.
  • Automation: Trigger updates as part of workflows, integrations, or external business logic.
  • Efficiency: Saves time and reduces human error when handling large volumes of data.

This is particularly beneficial for partners building custom solutions, handling third-party data imports, or working with complex data relationships across modules.

How to Update a Multi-Select Lookup Field via API?


There are two approaches to update multi-select lookup fields programmatically using the Zoho CRM API.

Approach 1: Using the Linking Module

By
creating a record in the linking module, the relationship between records is established and reflected in both modules' multi-select lookup fields.

Sample Deluge Script:

  1. mp = Map();
  2. mp.put("Trainers", trainerId);
  3. mp.put("Courses", courseId);
  4. createRecord = zoho.crm.createRecord("Trainers_and_Courses", mp);
  5. info createRecord;

NotesNote:

➤ Trainers_and_Courses - API name of the linking module.
➤ Courses_Multi_Select_Lookup - API name of the multi select look-up field present in the Trainers module.
➤ Trainers_Multi_Select_Lookup = API name of the 
multi select look-up field created in the Courses module. 


Approach 2: Directly Updating Using REST API (Without Linking Module)

You can also use the CRM REST API (v2.1) to directly update the multi-select lookup field.

Sample script:

  1. // Initialise a list to store multiple course record maps
  2. recordMapsList = list(); 

  3. // Create a map for the first course with its ID and name
  4. firstCourse = Map();
  5. firstCourse.put("id",5117245000058535290);
  6. firstCourse.put("name","Course Y");

  7. // Wrap the first course inside another map using the lookup field API name
  8. courseOneMap = Map();
  9. courseOneMap.put("Courses_Multi_Select_Lookup",firstCourse);

  10. // Add the first course map to the list
  11. recordMapsList.add(courseOneMap);

  12. // Create a map for the second course with its ID and name
  13. secondCourse = Map();
  14. secondCourse.put("id",5117245000058535300);
  15. secondCourse.put("name","Course Z");

  16. // Wrap the second course inside another map using the same lookup field API name
  17. courseTwoMap = Map();
  18. courseTwoMap.put("Courses_Multi_Select_Lookup",secondCourse);

    // Add the second course map to the list
  19. recordMapsList.add(courseTwoMap);

  20. // Create the final map for the multi-select lookup field
  21. multiSelectLookupFieldMap = Map();
  22. multiSelectLookupFieldMap.put("Courses_Multi_Select_Lookup",recordMapsList);

  23. // Add the field map to a list under the "data" key (required format for CRM API)
  24. data = list();
  25. data.add(multiSelectLookupFieldMap);

  26. // Create the final payload to send in the PUT request
  27. payload = Map();
  28. payload.put("data",data);

  29. // Make the API call to update the Trainer record with the associated courses
  30. updateRecord = invokeurl
  31. [
  32. url :"https://www.zohoapis.com/crm/v7/Trainers/5117245000059509243"
  33. type :PUT
  34. parameters:payload.toString()
  35. connection:"zohocrm"
  36. ];
  37. info updateRecord;

Note:

➤ Trainers - API name of the module where the multi-select lookup field for Courses exists.
➤ Courses_Multi_Select_Lookup - API name of the multi-select lookup field in the Trainers module. 

Conclusion:

Using either the Linking Module approach or the direct REST API update, you can effectively manage and automate multi-select lookup relationships in Zoho CRM. Choose the method that best fits your integration scenario.

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 FormsRetailOnline Data Collection Tool
                              Embeddable FormsBankingBegin Data Collection
                              Interactive FormsWorkplaceData Collection App
                              CRM FormsCustomer ServiceForms for Solopreneurs
                              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
                              Forms for Government
                              Intake FormsLegal
                              Mobile App
                              Form DesignerHR
                              Mobile Forms
                              Card FormsFoodOffline Forms
                              Assign FormsPhotographyMobile Forms Features
                              Translate FormsReal EstateKiosk in Mobile Forms
                              Electronic FormsInsurance
                              Drag & drop form builder

                              Notification Emails for FormsAlternativesSecurity & Compliance
                              Holiday FormsGoogle Forms alternative GDPR
                              Form to PDFJotform alternativeHIPAA Forms
                              Email FormsWufoo alternativeEncrypted Forms
                              Accessible FormsTypeform alternativeSecure Forms

                              WCAG

                                          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

                                                                  Use cases

                                                                  Make the most of Zoho Desk with the use cases.

                                                                   
                                                                    

                                                                  eBooks

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

                                                                   
                                                                    

                                                                  Videos

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

                                                                   
                                                                    

                                                                  Webinar

                                                                  Sign up for our webinars and learn the Zoho Desk basics, from customization to automation and more

                                                                   
                                                                    
                                                                  • Desk Community Learning Series


                                                                  • Meetups


                                                                  • Ask the Experts


                                                                  • Kbase


                                                                  • Resources


                                                                  • Glossary


                                                                  • Desk Marketplace


                                                                  • MVP Corner



                                                                    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