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

      • Bookmark order

        Hi all, We have a very big document/template that requires manual editing after doing a mail merge. To make this easier, I thought I would add bookmarks to navigate to the areas that will require editing. I thought these would be in order that they appear
      • Zoho Books | Product Updates | April 2025

        Hello partners, We’ve rolled out new features and enhancements to elevate your accounting experience. From FEC report to BillPay Add-on, these updates are designed to help you stay on top of your finances with ease. Export Transactions in Factur-X Format
      • Zoho Bookings API, timezone is not recognized when passed

        Has something changed? Time zone is being passed through API but it is NOT being recognized. response is not showing time zonetime that was passed through request. This is an URGENT issue as it is preventing bookings! Seems like this is due to a recent
      • Voicemail to Text Transcription

        Hello, We use the Twilio phone integration in Zoho Desk. When a voicemail is left, it creates a Ticket in Zoho Desk, and we are able to listen to the audio recording in the Ticket. My hope is to also have a voicemail-to-text transcription show up in the
      • Please don't remove the option to modify tax.

        Hi, I saw that the option to customize tax will be removed. This is VERY PROBLEMATIC for US companies who ship to different states because each zip code in the USA has its own tax rate for a single product. This is an awful idea. Please don't take this away.
      • Workflow to update the field "Deposit To" in Sales Receipt/Invoice

        After an invoice/sales receipt is created, I can't find a way to create a workflow that would update the field "Deposit To". Apparently, some other fields are visible in the workflow, but not the "Deposit To". Any insight?
      • payment gateway disabling in my ecommerce store

        hi i have disabled my payment gateway paytm from my website soigne from the backend but it is showing in my front end part when someone orders my products i want to remove it completelty so that it does not show in the front end part plz give me a suitable
      • Record GST Paid for Imported Goods

        In Australia, goods that imported from overseas needs to pay GST per invocied value. In most case, the freight forwader (logistic agent) paid this on behalf of importer (us), and invoice us in together in their freight invocie.  How do we setup a proper
      • subscribe email list for offer and updates is not working for zoho commerce

        my subscribing to email list is not working for offers and updates for my ecommerce website soignee it is saying please wait can anyone tell me the reason for this
      • Commerce service

        If I am selling a service in Commerce, how do I turn off shipping?
      • Widget JS SDK to Upload a photo to a record in a Module

        Good day,  I would really appreciate it if someone can assist me. I have written a widget, to be used in a Custom Module in CRM.  My goal: I want to upload a photo from my computer and display it in die "upload image" field. I am using the JS SDK: https://help.zwidgets.com/help/v1.1/index.html
      • how do i see a list of active End Users?

        looking for a list of who i sent invitations to be an End User?  who has signed up? 
      • Search WorkDrive File Contents from Creator

        Good afternoon, I am building out a Creator app where I want to allow users to input search terms from Creator that will return the appropriate files that contain those keywords from their Creator search. Is this possible?
      • Email template for customer notification on ticket reply is not being used

        I've set up an email template for notify contact up upon receiving a reply in ticket. When I send a reply to the ticket, it is not using that email template. It just sends a normal looking email. How do I make it so that the email template is being used?
      • Conversation to Resolution

        Good day, I'd like to know how others are doing it. When we close a ticket, we reply to the ticket via email with photos of the issue and disclaimers. Then, we enter (copy and paste) the exact text in the resolution for reporting. I asked Zogo for a possible
      • Zoho Sign & Analytics

        Hi, Is it possible to import data from Sign into Analytics?
      • Zoho Desk - Feature Request - Add more social channels on Community user profile

        Hi Team, While updating my profile here I noticed that it is only possible to add Facebook and Twitter social links. 1. Please consider adding at least LinkedIn and if possible, other popular channels. 2. Please consider renaming Twitter field name to
      • Train Zia answer bot on only part of Knowledge Base?

        We are trialing Zia answer bot and hope to use it on the knowledge base to help our users find the information they are looking for. I have found how to train Zia on the entirety of our knowledge base. But is there a way to train it on only certain categories
      • More Workflow Triggers

        We utilize a lot of workflows in our organization. Recently we've identified two use cases where we would like a workflow to run a function. Upon further checking, the workflow trigger wasn't available, or the only option was to run the workflow more
      • Modular cannot Edit in portals

        I have a custom module in CRM. If I create in either CRM or portals, I can edit it in the CRM but I can't edit in the portal. Even if it is created in the portal it wont edit. Anyone know why? I've created a new module and it works fine but this one
      • ViewID and Zoho Desk API

        I'm looking at the documentation for Listing contacts and it looks like you can filter by ViewID. I assume this is views created in a department or all departments. Is this correct? And if so, how do I find the ViewID for that view? EDIT: I see the view
      • Writing on sketch cards is bugged when zoomed in

        When zoomed in, it writes a noticeable distance above or to the side of where you're actually trying to write. The further you're zoomed in, the more noticeable it is. Zooming is also entirely absent on the desktop version.
      • Lost the ability to sort by ticket owner

        Hi all, in the last week or so, we have lost the ability to sort tickets by Ticket Owner. Unlike the other columns which we can hover over and click on to sort, Ticket Owner is no longer clickable. Is it just us, or are other customers seeing this too?
      • In Zoho CRM, is it possible to transition from Approach 1 to Approach 3 based on the contract End Date? automatically

        In Zoho CRM, is it possible to transition from Approach 1 to Approach 3 based on the contract End Date? I have one issue between Approach 1 to Approach 3 there is another transition Approach 2 Iam faceing the issue if use the blue print API means i able
      • Introducing Rollup summary in Zoho CRM

        ------------------------------------------Moderated on 5th July'23---------------------------------------------- Rollup summary is now available for all organizations in all the DCs. Hello All, We hope you're well! We're here with an exciting update that
      • HOW CAN I ADD NOTE FIELD IN EMAIL TEMPLATE?

        I have an email template which i use as a lost deal notification. I would like to mention "Note" field also which captures the reason for the lost deal. I am not able to do so and i checked with help desk and they confirmed that it is not possible. Is
      • Announcing Early Access to "Zoho CRM for Everyone" — A new and exciting update to Zoho CRM

        We are delighted to announce an Early Access to Zoho CRM for Everyone— a truly democratic approach to managing a CRM, gift-wrapped in an exciting and intuitive user interface. Here, multiple teams across an organization can coordinate among each other
      • Subject: Urgent: Unrelated Email Automation Issue – Request for Immediate Resolution

        Dear Zoho One Support Team, We are currently facing a critical issue with email automation in our Zoho One account. Despite deleting the associated templates and workflows, the same email templates are still being sent to our customers. This has become
      • Remove OpenAI Dependency for Zia Meeting Keynotes & Add Hebrew Support

        Hi Zoho Meeting Team, Hope you're doing well. We would like to request the following enhancements to the Zia integration for meeting keynotes in Zoho Meeting: 1. Remove the Dependency on OpenAI's ChatGPT Currently, Zia uses OpenAI’s ChatGPT to generate
      • Project Change Orders and Additions

        We are in the process of migrating from QuickBooks Online to Zoho Books. We have Zoho One and like the ability to sync all of our data across everything. And I like that projects work in a way that's less dumb than QuickBooks. I'm trying to figure out
      • ZOHO Task deleted accidently

        Hello team, Can you please help me with a deleted task that was created in general task list for one of my project. The task is very important to me as it was created by client. Please help me.
      • Global Fields

        Just like Global Sets for Picklists, we would like to have global fields for any kind of field. Three things that should be saved globally: 1. The Existence of the field 2. The Name and 3. Association with a module should be set up in a respective place
      • I dont see Timesheet configuration for my client

        I dont see Timesheet configuration for my client
      • Zoho Flow Needs to Embrace AI Agent Protocols to Stay Competitive

        Zoho Flow has long been a reliable platform for automating workflows and integrating various applications. However, in the rapidly evolving landscape of AI-driven automation, it risks falling behind competitors like n8n, which are pioneering advancements
      • Add Hebrew Support for Meeting Transcripts Provided by ZIA in Zoho Cliq

        Hi Zoho Cliq Team, Hope you're doing well. We would like to request the addition of Hebrew language support for the Meeting Transcript and Summary feature in Zoho Cliq. Currently the transcript and summary feature is available for recorded meetings and
      • 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 contacts, why was this feature not included. Now we have to miss out other contacts or enter them somewhere in the description.!!! this is bad.
      • Add RTL (Right-to-Left) Text Direction Support Across All Zoho Learn Editing Interfaces

        Hi Zoho Learn Team, Hope you're doing well. We would like to request an important enhancement to Zoho Learn regarding support for right-to-left (RTL) languages such as Hebrew and Arabic. 🔹 Current Issue While the Knowledge Base Article editor provides
      • update warehouse id for closed credit notes

        the code run successfully but its not updating the warehouse, i send payload of warehouse id and name ,then tried to clone exisitng with updated fields .. lost one week in this.. <?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Libraries\ZohoConnector;
      • Add Comment/Notes to Each Action in Zoho Flow for Internal Documentation

        It would be great if Zoho Flow could introduce a field to every action where we can make an internal note about why we are doing something with a specific action. This is especially helpful if more than one person from the organization handles automation
      • Monitor Ticket Transition Through Lifecycle Report

        Hello everyone, We have introduced lifecycle report under the pre-defined or static reports to provide better visibility of ticket transitions. For more information kindly refer to the help doc: Monitoring Ticket Transition with Lifecycle Reports Importance
      • Next Page