FAQs on Multi-Select Lookup (MxN) Field in Zoho CRM

FAQs on Multi-Select Lookup (MxN) Field in Zoho CRM

 Nearing 200th Kaizen Post – We want to hear from you!
Do you have any questions, suggestions, or topics you would like us to cover in future posts? Your insights and suggestions help us shape future content and make this series better for everyone. 

Hey everybody!!!
Welcome back to another post in the Kaizen series!
In this post, we will address some of the most frequently asked questions about the Multi-Select Lookup(MxN) field from the Zoho CRM developer community forum.

1. What is a Multi-select lookup field?

A multi-select lookup field in Zoho CRM lets you create a many-to-many relationship between two modules. This means a record in one module can be linked to multiple records in another module and vice versa.
For example, using an multi-select lookup field, you can associate multiple skills with an employee.

2. How does the Mutli-Select Lookup relationship work?

When you create a Multi-Select Lookup between two modules, for example, Employees and Skills, Zoho CRM automatically creates a hidden linking module, which is also known as an MxN module. This module stores the associations between records in the two modules, enabling you to track and manage many-to-many relationships.

For instance, if you link Employees and Skills, a linking module named EmpXSkills will be created.

This linking module is accessible only via API.

Backend Flow of multi-select lookup Relationship



In the linking module, two lookup fields (lookup fields with api names - Employees and Skills) will be created. The lookup fields, one pointing to Employees and the other pointing to Skills from the linking module, establish a connection between the linking module and its associated module.

Why you cannot use a lookup field for this use case? 
In Zoho CRM, a lookup field creates a one-to-many relationship between two modules i.e. one record in the source module can be linked to only one record in the target module.

Example :
If you create a lookup field for Skills in the Employees module, each employee can be linked to only one skill. So, use a multi-select lookup field instead of a lookup field when you need to represent complex relationships like one employee - many skills and one skill - many employees.

3. How to create a multi-select Lookup field using Zoho CRM APIs?

To create a Multi-Select lookup field between two modules using Zoho CRM APIs, follow these steps:

Step 1: Identify the Module API Name
Before creating the field, you should know the API names of the Employees and Skills modules. For that, use the Get Module Metadata API.  

Request URL  : {{api-domain}}/crm/v8/settings/modules
Request method : GET



Now, search for the Employees module in the response and note its API name.

Step 2: Use the Create Custom Fields API

To establish a many-to-many relationship between two modules, in our case, Employees and Skills, you need to create a custom field of type multi-select lookup in the Employees module (parent module).  Here, we will associate multiple skills to an employee.

This custom field requires:
  • The related module you want to link to - Skills.
  • A display field from the related module
  • The linking module (EmpXSkills), which stores the actual associations.
Use the Create Custom Fields API to create custom fields.

Request URL : {{api_domain}}/crm/v8/settings/fields?module=Employees
Request method : POST

Sample input :



{
    "fields": [
        {
            "field_label": "Skills", //Name of the field in your module
            "data_type": "multiselectlookup", //Type of the field
            "multiselectlookup": { //This JSON object contains the multi-select lookup relationship details

                "connected_details": { //Details about the module and field you want to link
                    "module": {
                        "api_name": "Skills" //API name of the related module
                    },
                    "field": {
                        "field_label": "Skills" //The field in the related module to display
                    }
                },
                "linking_details": { //Details about the junction or linking module that manages the many-to-many relationship
                    "module": {
                        "plural_label": "EmpXSkills" //Plural label of the junction module
                    }
                }
            }
        }
    ]
}


4. How Do You Find the Linking Module and Field API Names?

To know the API name of the linking module:
Use the Get Modules API and search for "generated_type" : "linking" in the response to identify MxN modules. In our case, EmpXSkills.

Request URL : {{api_domain}}/crm/v8/settings/modules
Request method : GET



To know the field API names in the linking module:
Use the Get Fields Metadata API to retrieve the API names of lookup fields within the linking module.

Request URL : {{api_domain}}/crm/v8/settings/fields?module=EmpXSkills
Request method : GET

5. How do I associate records via a multi-select lookup field using the Insert Records API in Zoho CRM?

To associate records using a multi-select lookup field, you must provide the record IDs from the related module. The association is made through the linking module.

Example :
Associating multiple skills with an employee using the multi-select lookup field.

Request URL : {{api-domain}}/crm/v8/Employees
Request method : POST

Sample input :


{
  "data": [
    {
      "Name": "Patricia",
      "Email": "patricia@mail.com",
      "Position": "Marketing Specialist",
      "Year_of_Experience": 5,
      "Skills": [   // API name of the multi-select lookup field in the Employees module
        {
          "Skills": { // API name of the lookup field in the linking module pointing to the Skills module
            "name": "Marketing",
            "id": "5725767000002149427"  //ID from the Skills module are mandatory to establish the link
          }
        },
        {
          "Skills": {
            "name": "Social Media Marketing",
            "id": "5725767000002149476"
          }
        }
      ]
    }
  ]
}



6. How do I associate an Employee's skills using the linking module in Zoho CRM?

To establish a relationship between the Employees and Skills modules through the linking module, use the Insert Records API to create a record in the linking module, EmpXSkills.

To do this,
  • Use the appropriate lookup field API names to reference the parent module.
  • You must need the record IDs from both the Employees and Skills modules to create the associations.
Request URL : {{api-domain}}/crm/v8/EmpXSkills
Request method : POST

Sample input :


{
  "data": [
    {
      "Name": "Patricia",
      "Employees": {
        "id": "5725767000002161001"  // Record ID from the Employees module
      },
      "Skills": {
        "id": "5725767000002149476"  // Record ID from the Skills module
      }
    }
  ]
}



7. When should I use create/update operations in the Employees module vs the EmpXSkills module?

                Employees Module

               EmpXSkills (linking) Module

Use when you want to create or update an Employee and associate Skills using the Multi-select Lookup field.

Use when you want to create or remove associations between existing Employee and Skill records without modifying the actual Employee or Skill data.

Creating a new employee and assigning their skills at once.

Managing relationships between existing records i.e., linking and unlinking skills to employees.


8. How to update a record in the linking module?

To update a record in the linking module, use the Update Records API.
Request URL : {{api-domain}}/crm/v8/EmpXSkills/5725767000006269044
Request method : PUT

Sample input :


{
    "data": [
        {
            "Skills": {
                "name": "Marketing",
                "id": "5725767000002170035" //Associating another skill with the employee 
            }
        }
    ]
}

In the above sample, we have replaced an existing skill associated with an employee with another Skill in the linking module.This is done by updating the Skills lookup field in the EmpXSkills record.

Please note that in the linking module, Skills is a lookup field, so you can associate only one skill per linking record. But in the Employees module, Skills is a multi-select lookup field, so an employee can be associated with multiple skills.

9. How to unlink records from the parent module as well as the linking module?

Unlink the associated records from the parent module:

Using the Update records API, you can remove an associated skill from an employee, use the "_delete": null key within the multi-select lookup field in the Employee record update.

Request URL : {{api-domain}}/crm/v8/Employees/5725767000006269044
Request method : PUT

Sample input :

{
"data": [
        {
            "Skills": [
               {
                    "Skills": {
                        "name": "Marketing", 
                        "id": "5725767000002170035" // The Skill record you want to unlink
                    },
                    "id": "5725767000007228047", //record ID - The record created in the linking module for the employee with the Marketing skill
                    "_delete" : null 
                }
            ]
        }
    ]
}



Replace an associated record from the linking module:

Use the Update Records API to replace an existing association in the linking module.

Request URL : {{api-domain}}/crm/v8/EmpXSkills/5725767000007228035
Request method : PUT

Sample input :


{
    "data": [
        {
            "Skills": {
                "name": "Java",
                "id": "5725767000005259075" //replacing a new skill 
            }
        }
    ]
}

In the above sample, we have replaced the existing skill with Java.

10. Why am I seeing the error "DUPLICATE_LINKING_DATA"  in the Update Records API

This error occurs when you try to associate records with the parent record that are already linked with the Multi-select lookup field. To resolve this, check the records you are trying to link and make sure your association is only with records that are not already linked.

Know your existing linked records:

Before the Update Records API, use the Get Related Records Data API and search for the multi-select lookup field. In our case, Skills is the multi-select lookup field created in the Employees module. This will return all records already associated.

Example :


The response returns all Skills already linked with that Employee.

Using this way, compare the IDs from the API response with the new records you are about to link, and only proceed with non-duplicate IDs. This avoids duplicate entries and prevents the "DUPLICATE_LINKING_DATA" error.

11. What happens if I delete a record in the linking module?

When you delete a record in the linking module, it only removes the association between the related records in the Employees and Skills modules.

Note :
  • Deleting a linking module record removes only the relationship between two records from the Employees and Skills modules.
  • Deleting an Employee or Skill record deletes all corresponding entries in the linking module as well.

12. How do I query linked records?

Use the COQL API to query multi-select lookup data by specifying the corresponding linking module's API name directly in your query. The linking module is treated as a separate module in Zoho CRM, so you can retrieve associated records by querying it like any other module.

Sample query :


{
  "select_query": "select Skills.Name as skill, Employees.Name as employee from EmpXSkills where Skills.Name like '%Marketing%'"
}


Use the Get Module Metadata API to know the linking module's API name.

13. How do I export multi-select lookup records using the Bulk Read API?

To export multi-select lookup data, linking module records efficiently, use the Bulk Read API with the linking module’s API name.

Request method : POST

Sample Request :


{
    "callback": {
        "method": "post"
    },
    "query": {
        "module": {
            "api_name": "EmpXSkills" //API name of the linking module
        },
        "fields": [
            "Employees.Name",
            "Employees.Year_of_Experience",
            "Skills.Name"
        ],
        "criteria": {
            "group": [
                {
                    "field": {
                        "api_name": "Employees.Year_of_Experience" 
                    },
                    "comparator": "greater_than",
                    "value": "4"
                },
                {
                    "field": {
                        "api_name": "Skills.Name"
                    },
                    "comparator": "contains",
                    "value": "Social"
                }
            ],
            "group_operator": "AND"
        }
    }
}


14. Can I import my linking module's data using the Bulk Write API?

Yes. Like the Leads and Contacts modules, you can also import linking module's data into Zoho CRM using the Bulk Write API by directly specifying the linking module’s API name.

If you are importing data that involves both a parent module, Employees and its associated MxN linking module, follow these steps:

1. Create separate CSV files:
  • One for the parent module - Employees
  • One for the linking module - EmpXSkills
2. Zip the files into a single ZIP file.
3. Upload the ZIP in a single Bulk Write API request.
4. Ensure accurate field mappings are provided in the API request body.

Refer to Kaizen #131 - Bulk Write for parent-child records using Scala SDK for more details on handling parent-child records.


15. Can I receive notifications if a multi-select lookup field in a module is modified or updated?

Yes, you can receive notifications when a MxN field is updated using the Notification API. To enable instant notifications for actions performed in a module, use the respective API names of the linking module in the input body.

Request method : POST

Sample input :


{
    "watch": [
        {
            "channel_id": "10000",
            "events": [
                "EmpXSkills.all"  //EmpXSkills represents the API name of the linking module
            ],
            "return_affected_field_values": true  
        }
    ]
}


16. Can I use criteria-based filtering when accessing multi-select lookup data using the Search API?

Yes, you can filter multi-select lookup data using the criteria parameter in the Search API's URL.

Here is an example that fetches records from the EmpXSkills linking module.

Request URL : {{api-name}}/crm/v8/EmpXSkills/search?criteria=((Secondary_Email:equals:patricia@mail.com)and(Skills:equals:Content_Marketing))
Request method : GET

Sample response :



                                                                                                                               x-----------------------------x


We trust that this post meets your needs and is helpful. Let us know your thoughts in the comment section or reach out to us at support@zohocrm.com 

Stay tuned for more insights in our upcoming Kaizen posts!


Other FAQs in the Kaizen series :


    • Sticky Posts

    • Kaizen #197: Frequently Asked Questions on GraphQL APIs

      🎊 Nearing 200th Kaizen Post – We want to hear from you! Do you have any questions, suggestions, or topics you would like us to cover in future posts? Your insights and suggestions help us shape future content and make this series better for everyone.
    • Kaizen #198: Using Client Script for Custom Validation in Blueprint

      Nearing 200th Kaizen Post – 1 More to the Big Two-Oh-Oh! Do you have any questions, suggestions, or topics you would like us to cover in future posts? Your insights and suggestions help us shape future content and make this series better for everyone.
    • Celebrating 200 posts of Kaizen! Share your ideas for the milestone post

      Hello Developers, We launched the Kaizen series in 2019 to share helpful content to support your Zoho CRM development journey. Staying true to its spirit—Kaizen Series: Continuous Improvement for Developer Experience—we've shared everything from FAQs
    • Kaizen #193: Creating different fields in Zoho CRM through API

      🎊 Nearing 200th Kaizen Post – We want to hear from you! Do you have any questions, suggestions, or topics you would like us to cover in future posts? Your insights and suggestions help us shape future content and make this series better for everyone.
    • Client Script | Update - Introducing Commands in Client Script!

      Have you ever wished you could trigger Client Script from contexts other than just the supported pages and events? Have you ever wanted to leverage the advantage of Client Script at your finger tip? Discover the power of Client Script - Commands! Commands
    • Recent Topics

    • How to update "Lead Status" to more than 100 records

      Hello Zoho CRM, How do I update "Lead Status" to more than 100 records at once? To give you a background, these leads were uploaded or Imported at once but the lead status record was incorrectly chosen. So since there was a way to quickly add records in the system no matter how many they are, we are also wondering if there is a quicker way to update these records to the correct "Lead Status". I hope our concern makes sense and that there will be a fix for it. All the best, Jonathan
    • Analytics for notes created

      Is there a way I can see how many notes were created per day? Via reporting or analytics?
    • Add Custom Reports To Dashboard or Home Tab

      Hi there, I think it would be great to be able to add our custom reports to the Home Tab or Dashboards. Thanks! Chad
    • Cannot update Recurring_Activity on Tasks – RRULE not accepted

      Hello, I am trying to update Tasks in Zoho CRM to make them recurring yearly, but I cannot find the correct recurrence pattern or way to update the Recurring_Activity field via API or Deluge. I have tried: Sending a string like "RRULE:FREQ=YEARLY;INTERVAL=1"
    • Add image to report...

      Greetings, I send a weekly color coded report via Creator email. I would like to add the legend somewhere in the report. Header, footer where ever. I have the legend saved on Google Drive and can access it via shared link. Sure someone has wanted to add
    • More controls for User Fields in CRM

      Dear All, We are here with a minor but crucial enhancement to the user fields—now set accessibility permissions to the records for user field. User field allows you to extend co-ownership of records to your peers. You can collaborate with them for certain
    • Calls to accounts rather than leads or contacts?

      So..... We have a dilemma and I'm hoping someone has encountered this before and figured out a fix. We have just migrated to Zoho. It's great.....expect for how "Calls" are handled.... We are B2B. We do not use the leads module. A "Lead/Prospect" for
    • Image Upload Field | Zoho Canvas

      I'm working on making a custom view for one of our team's modules. It's an image upload field (Placement Photo) that would allow our sales reps to upload a picture of the house their working on. However, I don't see that field as a opinion when building
    • Power of Automation :: Automated 'Delayed & Closed' Status Update Based on Due Date

      Hello Everyone, A custom function is a software code that can be used to automate a process and this allows you to automate a notification, call a webhook, or perform logic immediately after a workflow rule is triggered. This feature helps to automate
    • Lead Blueprint transition in custom list view

      Hi, Is It possible to insert the Blueprint transition label in a custom Canvas list view? I am using Lead module. I see the status, but it would be great if our users could execute the Blueprint right from the list view without having to enter the detailed
    • Range names in Zoho Sheet are BROKEN!

      Hi - you've pushed an update that has broken range names. A previously working spreadsheet now returns errors because the range names are not updating the values correctly. I've shared a video with the support desk to illustrate the problem. This spreadsheet
    • Has anyone integrated SMS well for Zoho Desk?

      Our company does property management and needs to be able to handle inbound sms messages which create a ticket for Zoho Desk. We then need to be able to reply back from Zoho desk which sends the user an sms message. This seems like a fairly common thing
    • populate email address and name in zoho desk?

      Is it possible to populate the email address and name in the zoho desk widget? We only use it in the context of an authenticated user, so we already know the user's name and email. Thanks,
    • Are there default/pre-built dashboards in Zoho Desk?

      Hi, I am looking for some pre-built dashboard templates in Zoho Desk, similar to what we can find in CRM/Projects, etc Thank you
    • Enable Locations for Expense

      Hi, please enable Locations (ex Branches) for Zoho Expense so that there is consistency between this app and Zoho Books. Thanks in advance.
    • Adding branded signature to tickets reply

      Hi, i am unable to figure out how to add signatures with logo to tickets reply. please advice .
    • Zoho Marketing Automation 2.0 - Landing Page function not working

      Dear Zoho Team, I am working on implementing Zoho Marketing Automation 2.0, and am now looking into the section "Lead Generation". If I open the "Landing Pages" section, I immediately get an Error code: Error: internal error occurred. Can you help me
    • Zoho Mail Android app update: Manage folders

      Hello everyone! In the latest version(v2.9) of the Zoho Mail Android app update, we have brought in support for an option to manage folders. You can now create, edit, and delete folders from within the mobile app. You can also manage folders for the POP
    • How to share ticket numbers across different ticket types

      I'm running an event and have three different ticket types. Add on Event + Main Event - Early bird Main Event only - Early bird Add on Event only - Early bird And Standard class - shown but not available until early bird finishes Add on Event + Main Event
    • How to keep track of bags, cans, drums of inventory?

      We buy and sell products that are packaged in bags 🛍️, cans🥫, drums🛢️, etc. with batch numbers. When we get a shipment of one of the products, how do we track we received (say) 10 cans each of 5L of a product and maybe we received 10 cans of another
    • Adding Social Media Buttons to Basic Campaigns

      Hi, I'm quote new to using Zoho Campaigns and I can't work out how to add Social Media Buttons into my basic campaign? In MailChimp there's a button that brings the icons into your campaign for you. I've tried adding the social media icons as 'buttons' in Zoho but it's not looking great. Can anyone help? Thanks!
    • Hide Inactive Social Sign-In Providers from Login Screen

      Hello Zoho Team, We hope you are doing well. Currently, Zoho One allows admins to configure security policies and enable or disable Social Sign-In options for third-party providers such as Apple, Google, Microsoft, LinkedIn, Yahoo, Twitter, Facebook,
    • [Free Webinar] AI Agents in Zoho Creator - Creator Tech Connect

      Hello Everyone! We welcome you all to the upcoming free webinar on the Creator Tech Connect Series. The Creator Tech Connect series is a free monthly webinar that runs for around 45 minutes. It comprises technical sessions in which we delve deep into
    • Download All Attached Files

      It would be extremely useful to have "download-all" functionality for downloading files attached to a task, subtask, comment, forum post or hosted in the "Documents" section etc. We've instructed our users to zip multiple files prior to uploading, but of course they forget all the time. Having to download lots of files one-at-a-time off a comment or task wastes a lot of time.
    • Ship via Carrier Not Working Since Commerce Update

      Since the recent update to the Commerce platform, I can no longer use the ship via carrier function. It will take me to the address screen and let me verify them but when I go to save and move tot he next screen it will not do anything. This is happening
    • automations: Can I execute a step on a specific date?

      I have created a form in Zoho forms, and created a contacts list. I have also begun setting up an automation with the intention of sending the form to the contact list on a specific date every month (via email) for the entire year (essentially sending
    • Zoho Expense - The ability to add detail to a Trip during booking

      As an admin, I would like the ability to add more detail to the approved Trips. At present a requestor can add flights, accommodation details and suggest their preferences. It would be great if the exact details of the trip could be added either by the
    • Adding Folders in Android App

      Is it possible to create a new email folder within the Zoho Mail Android app?  Or can this only be done from the desktop version of Zoho Mail? Cheers!
    • Schedule Exports for Regular Project Updates

      Tracking project data often means exporting data at regular intervals. Instead of manually exporting data every time, users can schedule exports for Phases, Tasks, and Tasks in Zoho Projects. These exports can be set to run once, daily, weekly, or monthly
    • Question about custom fields using Pivot Tables.

      I have created a pivot table showing annual revenue of a client and how much payment that client is paying my company. Is there a way using pivot table to add an additional field that subtracts those to fields / shows me a percentage of that difference?
    • Request for Light/Dark Mode

      Would love the ability to switch between Light and Dark mode similar to Zoho CRM. https://help.zoho.com/portal/en/community/topic/introducing-dark-mode-light-mode-a-new-look-for-your-crm
    • Signature field is showing black

      Hello, When customer signed the service form, it is showing as below picture Phone model: iPhone 16 Pro We tried delete and install application, but it not solved. This has on phone of a few person. There is any advice to solve this?
    • Journey Email - Ignored Contacts

      I have a journey setup which simply sends a string of emails over time. For some reason I am getting large amounts of the contacts who enter the first email being ignored and I can't find anywhere in reports or audit logs why these contacts are not
    • Involved account types are not applicable when create journals

      { "journal_date": "2016-01-31", "reference_number": "20160131", "notes": "SimplePay Payroll", "line_items": [{ "account_id": "538624000000035003", "description": "Net Pay", "amount": 26690.09, "debit_or_credit": "credit" }, { "account_id": "538624000000000403", "description": "Gross", "amount": 32000, "debit_or_credit": "debit" }, { "account_id": "538624000000000427", "description": "CPP", "amount": 1295.64, "debit_or_credit": "debit" }, { "account_id": "538624000000000376", "description":
    • Zoho Books - Include Payment Terms as a Custom View filter

      It would be great if you could created a custom view based on Payment Terms. This would be really handy for seeing a list of customers who have credit terms. A workaround is not required. I could do something with a creditor checkbox, but it would be
    • How to update changed purchase account of item in invoice

      I have selected the wrong purchase account for various articles and created invoices. I had to adjust the purchase account in the article afterwards, but the old purchase account is still posted in the transaction-journal of the invoice. To adjust the
    • Help - Zoho CRM notification on mobile (IOS/Android)

      Hello Community! Can I get the IOS/Andoid CRM app to notify me of events, calls, etc. due as I can with MANY other apps?   I am running the free Zoho I would like this to be native to the Zoho CRM app. I do not want to write a sep. mobile app
    • Zoho Books Idea - Include another field in Bank Details for Address

      Hi Books team, Currently use the Description field in the Bank Details to store the bank's address. This works fine but it would be great if you could add another field for Bank Address, so that other notes about the bank account could be stored in the
    • a question about the COQL API v8

      When I specify eight or more values in a WHERE IN clause and execute it, an error occurs. Is there a limit to the number of values that can be specified in a WHERE IN clause? ↓Error select * FROM Vendors WHERE (id in (1, 2, 3, 4, 5, 6, 7, 8, 9)) ↓Success
    • Zoho Books Idea - Bank Details Button on Banking

      Hi Books team, Sometimes I'm asked to share bank details with a customer or a colleague. So I go to the Banking Module, find the correct bank account, click Setting > Edit, then copy and paste the bank details. Wouldn't it be great if there was a button
    • Next Page