Kaizen #176 - Optimizing the Use of Record ID Variables in Zoho CRM Queries

Kaizen #176 - Optimizing the Use of Record ID Variables in Zoho CRM Queries


Hello everyone!

Welcome to another week of Kaizen!


Today, we are back with another one on Queries.
In this post, we will discuss how you can optimize record ID as a variable in Queries.

What are variables in Queries?

Variables are placeholders in queries that take values at runtime. Variables make queries flexible and reusable, avoiding the need to hard-code data.

When you create a query, you can leverage record ID variables in two ways:
  1. Filter By field
  2. Criteria
Each method has its own benefits and considerations. Let's explore them in this post.

1. Using record ID variable in the "Filter By" field

When you use the record ID variable in the "Filter By" field of a query, you streamline the data retrieval process by directly targeting the specific records you need. This method is particularly useful when you want to narrow down your search to specific record based on their IDs. Simply put, this behaves as the Get Record by ID.

Consider an example, where Interested_Product is a lookup in Contacts. Our aim is to get the details of the product that the contact is interested in. We can create a query of type CRM - Module as shown in the following image.

  1. The base module is Contacts, and the related module is Products that is linked via the lookup field.
  2. Choose the required fields you want to retrieve through the query.
  3. In Filter by, select Record ID.
  4. Give the variable to hold the contact's ID in the Record ID field. The format is {{variable_name}}.
  5. The query assigns the ID of the contact dynamically during runtime.
  6. Click Next.
  7. A pop-up asks for the value of the variable.

  8. Input the ID of the contact and click Save.
  9. The response contains the fields that were queried for.

Benefits of having the record ID variable in "Filter by"

  • Efficiency: Directly retrieves the relevant records, reducing the need to sift through unnecessary data.
  • Simplicity: Easy to set up and understand, making it ideal for direct queries.

Considerations

  • Limited Flexibility: May not be suitable for complex queries requiring multiple conditions or criteria.
  • Specific Use Cases: Best used for scenarios where you have a clear and specific record ID to filter by.

2. Using Record ID Variable in Criteria While Fetching Related Records

Using the record ID variable in criteria while fetching related records allows for more complex and dynamic queries. This approach is useful when you need to retrieve related data based on certain conditions or criteria.
Consider an example where you want to retrieve deals of a contact. A deal can have multiple contacts, but you want to fetch only those deals that are related to a particular contact. This case warrants the need for criteria to filter based on the ID of the contact.
Construct a query as follows:
  1. Create a CRM - Module type query for the Deals module.
  2. Choose Contacts as the Related Module.
  3. Select the fields from these two modules that you want to retrieve.

  4. Select "Criteria" and create a variable for the record ID of the contact.

  5. Click Save and click Next.
  6. Give a contact ID for the variable in the pop up.

  7. Click Save and click Next.
  8. You can see the response to the query.

Benefits of using record ID variable in "criteria"

  • Flexibility: Allows for more complex queries with multiple criteria.
  • Dynamic Data Retrieval: Useful for scenarios where the criteria for related records may change based on different conditions.
  • Comprehensive Data: Fetches a broader range of related records, providing a more holistic view of the data.

Considerations

  • Complexity: More suitable for complex queries and requires deeper understanding of how modules are related in Zoho CRM.

Conclusion

Both methods offer their opportunities and challenges in Zoho CRM's data management.
Choosing the right approach depends on your specific needs and the complexity of your queries. For efficient and simple data retrieval, using the record ID variable in the "Filter By" field is ideal.
For more complex and dynamic queries, leveraging the record ID variable in criteria while fetching related records offers greater flexibility.

Experiment with both approaches to see which one fits your use case best.

Share your experiences in the comments or write to us at support@zohocrm.com, and help others optimize their data retrieval strategies in Zoho CRM!

Stay tuned for more posts in this series!

Cheers!

----------------------------------------------------------------------------------------------------------------------------------
      • Recent Topics

      • How can I setup Zoho MCP with Chat GPT

        I can set up custom connections with Chat GPT but I cat an error when I try to set it up. The error is: "This MCP server can't be used by ChatGPT to search information because it doesn't implement our specification: search action not found" Thoughts?
      • Export Invoices to XML file

        Namaste! ZOHO suite of Apps is awesome and we as Partner, would like to use and implement the app´s from the Financial suite like ZOHO Invoice, but, in Portugal, we can only use certified Invoice Software and for this reason, we need to develop/customize on top of ZOHO Invoice to create an XML file with specific information and after this, go to the government and certified the software. As soon as we have for example, ZOHO CRM integrated with ZOHO Invoice up and running, our business opportunities
      • Kaizen# 209 - Answering Your Questions | All About Client Script

        Hello everyone! Welcome back to another exciting Kaizen post! Thanks for all your feedback and questions. In this post, let's see the answers to your questions related to Client Script. We took the time to discuss with our development team, carefully
      • API ZOHO CRM Picket list with wrong values

        I am using Zoho API v.8. with python to create records in a custom module named "Veranstaltung" in this custom module I've got a picket list called "Email_Template" with 28 Values. I've added 8 new values yesterday, but if I try to use on of those values
      • Group Emails

        I have synced Zoho CRM to Campaigns but there are certain email not synced. showing it is Group Emails, but this email ids belongs to different individuals. please provide a solution as i nedd to sync the same.
      • "Is Zoho CRM customer" vs "Is linked with Zoho CRM"

        Recently while building a Flow, I was setting up a Decision action following a Zoho Invoice Fetch record action. There were 2 choices that I had not seen as something I could manually action in Zoho Invoice: "Is Zoho CRM customer" and "Is linked with
      • Search in Zoho Community Not Working

        I realize this is a bit of a meta topic, but the search for the various Zoho Communities appears to not be working. I'm under the impression that they run on some version of the Zoho Desk platform, so I'm posting this here.
      • How to get the Dashboard page to be the first page when you open the app

        So when it opens on a tablet or phone it opens on the welcome page, thanks.
      • Enable / show scroll bar when Mega Menu is opened

        Hey there I am using the mega menu add-on and experience a "flicker" whenever the mega menu opens. The reason is, that the scrollbar, which has a width of a few pixels, stops showing when the mega menu opens. As the scrollbar disappears the whole page
      • Client Script | Update #13 - Introducing ZRC: Simplified HTTP request library

        Hello Developers! Are you tired of juggling different methods to make API calls? Are you confused with multiple syntaxes and version restrictions? Have you ever wished for one simple way to make all API calls in CRM? We heard you :) Here comes ZRC (Zoho
      • 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
      • Selection Filed for Data Export section

        Hi FSM Team, I hope you are all doing well. I would like to share an idea for future development based on my experience. Currently, in FSM, we can only download up to 5,000 records at a time. If the development team could add a selection option to choose
      • Text wrap column headers in reports?

        Is it possible to auto wrap column headers so that a longer multi-word header displays as two lines when the column is narrower than the width of the header title?
      • Zoho Desk Down

        Not loading
      • What if I dont see contacts on the left side list

        My CRM does not show the contacts tab. In order to create list this is needed and I cant find it.
      • 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!
      • Create custom rollup summary fields in Zoho CRM

        Hello everyone, In Zoho CRM, rollup summary fields have been essential tools for summarizing data across related records and enabling users to gain quick insights without having to jump across modules. Previously, only predefined summary functions were
      • Transitioning to API Credits in Zoho Desk

        At Zoho Desk, we’re always looking for ways to help keep your business operations running smoothly. This includes empowering teams that rely on APIs for essential integrations, functions and extensions. We’ve reimagined how API usage is measured to give
      • 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
      • Resetting auto-number on new year

        Hi everyone! We have an auto-number with prefix "D{YYYY}-", it generates numbers like D2025-1, D2025-2, etc... How can we have it auto-reset at the beginning of the next year, so that it goes to D2026-1? Thanks!
      • Figma in Zoho Creator

        Hi Team, I’m creating a form using Figma and would like to know how to add workflows like scheduling, custom validation, and other logic to it. Can anyone help me understand how to set this up for a Figma-based Creator UI form?
      • Experience effortless record management in CRM For Everyone with the all-new Grid View!

        Hello Everyone, Hope you are well! As part of our ongoing series of feature announcements for Zoho CRM For Everyone, we’re excited to bring you another type of module view : Grid View. In addition to Kanban view, List view, Canvas view, Chart view and
      • Microsoft Phone Link

        Does anyone know if you can use Microsoft Phone Link to make calls through Zoho?
      • Voip Phone system that integrates with Zoho

        Just checking to see if anyone could tell me what phone system they are using with Zoho that is on the list of systems that integrate with Zoho.  I use Vonage and have been with them for quite a few years but their service has really gone down hill and
      • Removing Related Modules Lookup Fields Assignment / Relationship

        Issue: When creating a related list, I accidently selected module itself creating a circle reference. See attached. Situation: I wish to relating a custom module called "Phone Calls" to Leads and Contacts. Outcome: 1) I either want to remove the this
      • [Product Update] TimeSheets module is now renamed as Time Logs in Zoho Projects.

        Dear Zoho Analytics customers, As part of the ongoing enhancements in Zoho Projects, the Timesheets module has been renamed to Time Logs. However, the module name will continue to be displayed as Timesheets in Zoho Analytics until the relevant APIs are
      • Restore lost Invoice!

        Some time ago I tried to Upgrade from Invoice to Books. I not upgraded and staid n Invoice. Now i tried again and first i deleted the old trial of books. But now all is gone, PLEASE HELP!! i have no backup and i have to have at least 7 years data retention by law. 
      • Connecting two modules - phone number

        Hi, I’d like some guidance on setting up an automation in Zoho CRM that links records between the Leads module and a custom module called Customer_Records whenever the phone numbers match. Here’s what I’m trying to achieve: When a new Lead is created
      • Kaizen #210 - Answering your Questions | Event Management System using ZDK CLI

        Hello Everyone, Welcome back to yet another post in the Kaizen Series! As you already may know, for the Kaizen #200 milestone, we asked for your feedback and many of you suggested topics for us to discuss. We have been writing on these topics over the
      • Formula fields not refreshing until page is reloaded

        I need help/advice about the formula fields and how I can refresh the information in real-time. We have two formula fields on our deals page which show calculated prices: One formula is in a subform which calculates the subform total + 1 other field amount
      • Can you prevent closing Ulaa window when the last tab is closed (inadvertently)?

        Most browsers have started to bring this feature in to prevent closing their windows when the last tab is closed (inadvertently). I hope Ulaa should get this in too.
      • Enhancements to finance suite integrations

        Update: Based on your feedback, we’ve updated the capabilities for integration users. In addition to the Estimates module, they can now create, view, and edit records in all the finance modules including Sales Order, Invoices, Purchase Order. We're also
      • Seriously - Create multiple contacts for leads, (With Company as lead) Zoho CRM

        In Zoho CRM, considering a comapny as a lead, you need us to allow addition of more than one contact. Currently the Lead Section is missing "Add contact" feature which is available in "Accounts". When you know that a particular lead can have multiple
      • can I link a contacts to multiple accounts

        can I link a contacts to multiple accounts
      • Rotate an Image in Workdrive Image Editor

        I don't know if I'm just missing something, but my team needs a way to rotate images in Workdrive and save them at that new orientation. For example one of our ground crew members will take photos of job sites vertically (9:16) on his phone and upload
      • Free webinar! Digitize recruitment and onboarding with Zoho Sign and Zoho Recruit

        Hello, Tired of being buried in onboarding paperwork? With the integration between Zoho Sign and Zoho Recruit, a powerful applicant tracking system, you can digitize and streamline the entire recruitment and onboarding process, all from one platform.
      • Resume Harvester: New Enhancements for Faster Sourcing

        We’re excited to share a set of enhancements to Resume Harvester that make sourcing faster and more flexible. These updates help you cut down on repetitive steps, manage auto searches more efficiently, and review candidate profiles with ease. Why we built
      • is it possible to add more than one Whatsapp Phone Number to be integrated to Zoho CRM?

        so I have successfully added one Whatsapp number like this from this User Interface it seems I can't add a new Whatsapp Number. I need to add a new Whatsapp Number so I can control the lead assignment if a chat sent to Whatsapp Phone Number 1 then assign
      • Open Activities view.

        I really like the new views for the open and closed activities inside the deals. But when you are in the tab view instead of the column view you can only complete and edit the open activity there isn't the 3 dot option to be able to delete the activ
      • Potentially Outdated and Vulnerable Chromium Engine Installed by Ulaa Browser Installer

        I just installed Ulaa Browser a few minutes ago. Whats My Browser page shows I am using an outdated Chromium engine meaning I might be vulnerable for security exploits that might have got fixed in the new version.
      • Next Page