Kaizen #166 - Handling Query Variables in Zoho CRM

Kaizen #166 - Handling Query Variables in Zoho CRM


Hello, Code Enthusiasts! 

Welcome to another week of Kaizen!

This week, we'll dive into handling variables in Zoho CRM Queries and see how they can be deployed in Kiosk to dynamically retrieve data. This technique is especially useful for integrating data from third-party applications or CRM itself into your custom interface, such as Canvas and Kiosk. 

Variables

Variables are placeholders in Queries that are replaced with real values at runtime. Instead of hard coding data, you can use variables to make your Queries flexible and reusable.

Syntax: {{Variable_Name}}

Query variables in Zoho CRM function differently from conventional Zoho CRM variables. While CRM variables act as containers for dynamic values that can be stored and reused anywhere within the organization, query variables are designed to receive their values at runtime.

Query variables enhance flexibility and are specifically used in:
  • COQL: To dynamically filter and retrieve data.
  • REST API: For runtime data fetching based on specific parameters.
  • Query Criteria: To define conditions dynamically for fetching records.

How to Use a Variable?

To use variables, ensure the fields providing the variable values are available in the context where the Query is executed.

Let’s say you want to evaluate a marketing campaign's performance. For this, you need to fetch all leads with a specific lead source. Since each campaign is associated with a different lead source, you can define the lead source as a variable. When viewing a campaign's details, the lead source will be passed dynamically to the Query.

Business Scenario : Nearby Delivery Hubs

Imagine a telecommerce platform using Zoho CRM to manage sales and deliveries. When a customer provides their PIN code, the salesperson must confirm with the customer for a nearby post office for package pick-ups and drop-offs in Kiosk.

With Zoho CRM Queries, you can achieve this by dynamically fetching the nearby post offices list based on the customer's PIN code and displaying it on the Contact record’s detail page. Here's how to set it up using the Kiosk feature.

Setting Up the Query in Kiosk

1. Access Kiosk Studio

  • Log in to Zoho CRM.
  • Go to Setup > Customization > Kiosk Studio and click Create Kiosk.

2. Configure the Current Module

  • Choose the module where the Kiosk will be deployed.
    For this example, select Contacts to use the PIN code from the Contact record.

  • Configuring this Current Module is mandatory to use variables from the current record. 

3. Add a Screen

  • Click the + icon on the flowchart and select Screen.
  • Name the screen and click Add.

4. Add a Query

  • Under Display Elements, choose Get Data Via Queries.
  • Click New Query and then Add Query to create a new one.

5. Set Up the Data Source

  • Any custom source has to be enrolled either in the Trusted Domains or in the Connections. For demo, 
  • In the Add Query pop-up, click Source and create a new source.
    For this demo, we’ll add India Post to fetch post offices based on PIN codes.
  • Add default Headers and Parameters to the source if any. This will be added by default whenever the source is used in a query. 

6. Define the Query

  • In the Information section, provide the query’s Name and API Name to refer to the query wherever needed.
  • Use the endpoint URL with a variable, e.g., https://api.example.com/post_offices/{{Mailing_Zip}}.
  • You can add headers and parameters specific to the query, but let us skip that for the demo. 
  • Add a JavaScript serializer to process the Query response. For our case, we will serialize the response with return result[0].PostOffice;
  • You can test your serializer with the help of Preview. Once finished, provide a test value to the variable for generating Schema for the Query Response.
    The test value you provide is temporary and not permanent. The value of a variable will be declared using merge fields when you associate the query with a component. Check Step 7 to know how it is used in our demo. 

    You can also manipulate the response by changing data types of keys in the raw response. To keep the demo simple, let's go with the raw response. 

7. Link the Query to Kiosk

  • Use Dynamic Parameters to map the variable to the Mailing Zip field from the Contact record. Enter # to merge the fields. 
  • In Choose Fields, select which data to display in the Kiosk.
  • You can further manipulate the query response in the Record Preferences section.
    Select your preference to view the response as a Single Record or Multiple Records.
    • For Single Record, choose the data that has to be displayed from the query response and click Save.
    • For Multiple Records, fill in the following details as shown in this image. 
    • The Selection Limit helps you with the maximum number of records that have to be chosen in the kiosk after publishing. 
    • Identifier field functions as the primary field to identify each record. 
    • In the fields section, choose the data that has to be displayed from the query response.

  • Customize the Kiosk button and click Done to save your configuration.
  • 8. Test and Publish

    Test the Kiosk using a sample Record ID from the Contacts module. If successful, the list of nearby post offices will display in an iframe as it would appear on the Contact detail page.


    Once satisfied, publish the Kiosk to make it live. 
    Let us check the Kiosk from the Contacts detail page. 

    Example Scenarios

    • Loan Approval: You can display a customer's CIBIL score using their Social Security Number (SSN) directly within a Canvas. The SSN serves as a runtime variable, allowing you to approve loans without manual data entry and shifting tabs.
    • Customer Support: In a Records Detail View kiosk, display all high priority tickets linked to an account. The current account's ID acts as a runtime variable, ensuring that support agents have immediate access to relevant queries and resolve issues faster.
    • Insurance Verification: In a Records Detail View kiosk, the customer's ID proof number can be used to verify their details on official government sites. The ID proof number dynamically functions as a variable, streamlining the insurance verification process.
    We hope you found this post informative and beneficial.

    If you have any queries or a topic to be discussed, reach out to us at support@zohocrm.com or drop your comments below. 

    Cheers!

    ---------------------------------------------------------------------------------------------------------

      Access your files securely from anywhere


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







                                  Zoho Developer Community




                                                        • Desk Community Learning Series


                                                        • Digest


                                                        • Functions


                                                        • Meetups


                                                        • Kbase


                                                        • Resources


                                                        • Glossary


                                                        • Desk Marketplace


                                                        • MVP Corner


                                                        • Word of the Day


                                                        • Ask the Experts



                                                                  • Sticky Posts

                                                                  • 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.
                                                                  • Kaizen #226: Using ZRC in Client Script

                                                                    Hello everyone! Welcome to another week of Kaizen. In today's post, lets see what is ZRC (Zoho Request Client) and how we can use ZRC methods in Client Script to get inputs from a Salesperson and update the Lead status with a single button click. In this
                                                                  • Kaizen #222 - Client Script Support for Notes Related List

                                                                    Hello everyone! Welcome to another week of Kaizen. The final Kaizen post of the year 2025 is here! With the new Client Script support for the Notes Related List, you can validate, enrich, and manage notes across modules. In this post, we’ll explore how
                                                                  • Kaizen #217 - Actions APIs : Tasks

                                                                    Welcome to another week of Kaizen! In last week's post we discussed Email Notifications APIs which act as the link between your Workflow automations and you. We have discussed how Zylker Cloud Services uses Email Notifications API in their custom dashboard.
                                                                  • Kaizen #216 - Actions APIs : Email Notifications

                                                                    Welcome to another week of Kaizen! For the last three weeks, we have been discussing Zylker's workflows. We successfully updated a dormant workflow, built a new one from the ground up and more. But our work is not finished—these automated processes are


                                                                  Manage your brands on social media



                                                                        Zoho TeamInbox Resources



                                                                            Zoho CRM Plus Resources

                                                                              Zoho Books Resources


                                                                                Zoho Subscriptions Resources

                                                                                  Zoho Projects Resources


                                                                                    Zoho Sprints Resources


                                                                                      Qntrl Resources


                                                                                        Zoho Creator Resources



                                                                                            Zoho CRM Resources

                                                                                            • CRM Community Learning Series

                                                                                              CRM Community Learning Series


                                                                                            • Kaizen

                                                                                              Kaizen

                                                                                            • Functions

                                                                                              Functions

                                                                                            • Meetups

                                                                                              Meetups

                                                                                            • Kbase

                                                                                              Kbase

                                                                                            • Resources

                                                                                              Resources

                                                                                            • Digest

                                                                                              Digest

                                                                                            • CRM Marketplace

                                                                                              CRM Marketplace

                                                                                            • MVP Corner

                                                                                              MVP Corner









                                                                                                Design. Discuss. Deliver.

                                                                                                Create visually engaging stories with Zoho Show.

                                                                                                Get Started Now


                                                                                                  Zoho Show Resources

                                                                                                    Zoho Writer

                                                                                                    Get Started. Write Away!

                                                                                                    Writer is a powerful online word processor, designed for collaborative work.

                                                                                                      Zoho CRM コンテンツ





                                                                                                        Nederlandse Hulpbronnen


                                                                                                            ご検討中の方





                                                                                                                      • Recent Topics

                                                                                                                      • [IDEA] Bring Layout - Conditional Rules and Client Scripts to Zoho Books

                                                                                                                        The problem We run Zoho Books with two e-invoicing integrations: myData (Greek tax authority, AADE) and PEPPOL (EU e-invoicing). Between the two, our Invoice form carries a large number of custom fields — document type codes, VAT exemption categories,
                                                                                                                      • Don't send customer email when creating a ticket

                                                                                                                        Hi Is there an easy way to stop the system sending an email to the customer when we manually create ticket.
                                                                                                                      • Zoho CRM Layout Rules: Nine New Actions, Profile-Based Execution, and Interactive Preview

                                                                                                                        Hello everyone, Availability: This feature is now available for customers in the JP and SA DCs. It is planned to be released for other customers in soon. We’re excited to announce powerful new enhancements to Layout Rules in Zoho CRM - a feature built
                                                                                                                      • Zia Agents: quando a Inteligência Artificial do Zoho para de sugerir e passa a agir

                                                                                                                        Decidi criar um artigo com um panorama prático sobre o que são os agentes do Zia Agents, como funcionam de verdade dentro do ecossistema Zoho e o que aprendi implementando um agente de qualificação de leads em produção. De onde veio a idéia do artigo?
                                                                                                                      • Zoho Desk Android app update: Manage Custom Module records, View Record Counts for Sub Modules.

                                                                                                                        Hello everyone! We have introduced an option to add, edit and delete Custom Module records within the Zoho Desk Android app. Now, you can also view the record counts for sub modules (Time Entry, Attachments, Activities) in the ticket details screen. Please
                                                                                                                      • Automating CRM backup storage?

                                                                                                                        Hi there, We've recently set up automatic backups for our Zoho CRM account. We were hoping that the backup functionality would not require any manual work on our end, but it seems that we are always required to download the backups ourselves, store them,
                                                                                                                      • How to preserve Lead Creation Date, UTM parameters, and custom fields during Lead Conversion?

                                                                                                                        We are optimizing our MQL journey. When converting leads to contacts/deals, we need to ensure that the original system Lead Creation Date and UTM tracking parameters (Source, Medium, Campaign) are not lost or archived, as our teams require them for accurate
                                                                                                                      • Problem with currency field in Zoho CRM

                                                                                                                        Hi Guys Zoho Books has a feature in currency fields that automatically converts decimal numbers with commas ( , ) to period format ( . ) when pasting them. For example: R$ 2,50 --> R$ 2.50 Is this behavior available in Zoho CRM? I couldn't find any configuration
                                                                                                                      • Sub-projects

                                                                                                                        Hi,  Can we create a sub-project.   Client1 1. project1     1.1 sub-project1    1.2 sub-project2 2. project2    2.1 sub-project1    2.2  sub-project2
                                                                                                                      • Using Items from Books as product/plan Add-Ons

                                                                                                                        Hey, It'll be great to use Items from Books as product/plan Add-Ons. Ed
                                                                                                                      • Inspection Table

                                                                                                                        Hello Latha, We created a job sheet that includes the new table (Inspection Table) which was introduced recently. However, agents are not able to see the rows in the inspection table. Could you please investigate this issue and get back to us? Please
                                                                                                                      • Custom Button Creation from Layout Editor in Zoho CRM

                                                                                                                        Hello All, Buttons in Zoho CRM act as triggers that perform a specific action when clicked. Zoho CRM includes a set of system buttons that help you carry out common actions with a single click. Beyond these, your organization can create custom buttons
                                                                                                                      • Automatic login options for customer portal

                                                                                                                        The customer portal is nice for zoho subscriptions, but there are no options to automatically login to it, so if a user is logged into their account inside of my product, I can't create a link that will let them login to their dashboard. Could we have
                                                                                                                      • Square Payments for Subscriptions

                                                                                                                        I'd love to be able to use Square Payments for Subscriptions with my customers. I already use it for Zoho Books Please have this considered. It would really help my business
                                                                                                                      • "code":3001 ["Failed to update data."]

                                                                                                                        I would like to seek your expertise - I might be wrong on my approach also.. I highly appreciate your advice. 1 problem remains is when a new row was added on the existing one [from another form that trigger upon Successful form submission ], it gets
                                                                                                                      • Add a MATRIX field to the forms creation

                                                                                                                        Same as Zoho forms, we need a Matrix field in Zoho Creator forms, is very usefull
                                                                                                                      • Discount Per Line Item

                                                                                                                        We are a phone company. Sometimes, when we sign up customers, our sales team would like to provide recurring discounts on certain addons. Presently, we have no way of doing this so when we provide discounts, we are forced to simply reduce the price of
                                                                                                                      • Introducing template migration: Move your Docusign templates to Zoho Sign in minutes

                                                                                                                        Moving to a new e-signature tool usually comes with a catch: recreating every template from scratch. For teams that rely on dozens of carefully built templates—each with the right recipient roles, fields, and placements—that manual rework is often the
                                                                                                                      • Error Code 2945 , PATTERN_NOT_MATCHED

                                                                                                                        Hi, I am trying out Zoho Creator API.  However, I always get the following <response>     <code>2945</code>     <message>PATTERN_NOT_MATCHED</message> </response> However, error code list error as Invalid Ticket. I do not know what is wrong. 
                                                                                                                      • Create a list of products and automatically associate them with new deals

                                                                                                                        Hello, I have a store with WooCommerce, and I want to import orders into my pipeline. But I haven't found a way to import the order with the associated products. So, do I have to create the deals and then manually add the products to them? That's double
                                                                                                                      • List of Mail Merge Templates via Deluge

                                                                                                                        Hello, Is it possible to get a list of the mail merge templates I've created in CRM within a custom function? I want to retrieve them and put them in a dropdown list but all I get is a scopes error! Can anyone see where I'm going wrong? Is this even possible?
                                                                                                                      • Zoho Advanced Analytics with Team Module support – Now includes teams, notes, and fields in reports & insights

                                                                                                                        Greetings all, Advanced Analytics is now accessible via Zoho CRM's team modules, which means you can add team modules—plus their notes and fields—for inclusion in reports, insights, and other analytical functions. Alongside the standard and custom modules
                                                                                                                      • WhatsApp conversations are no longer linked to existing threads after reconnecting the channel

                                                                                                                        Hi everyone, We have an existing WhatsApp channel in Zoho Desk. We temporarily disabled it, renamed it, and then re-enabled it while reassigning our bot. Since then, all previous WhatsApp conversations are still visible in the history, but we can no longer
                                                                                                                      • Zoho Assist Feature Update: July 2026

                                                                                                                        Elevate to Admin Mode for iOS devices Technicians can now elevate an active session to Admin Mode directly from the iOS app. This feature lets the technician switch the remote computer from a standard user account to an admin account by entering credentials
                                                                                                                      • Bulk deleting Zoho CRM records using Deluge, COQL and CRM API

                                                                                                                        Hello everyone, During CRM implementations, data cleanup is a common task, especially after testing, migrations, imports, or integration development. I created a reusable Deluge function that performs bulk deletion using the Zoho CRM API. The approach:
                                                                                                                      • Can't connect CalDAV

                                                                                                                        ### Issue Summary Can't connect to my calendars using CalDAV and the URL `https://calendar.zoho.eu` ### Steps to Reproduce 1. Tried to connect on multiple devices, on multiple OS's (Android DAVx, Thunderbird, Gnome Calendar, Apple Caneldar). 2. When I
                                                                                                                      • CRM x WorkDrive: We're rolling out the WorkDrive-powered file storage experience for existing users

                                                                                                                        Release plan: Gradual rollout to customers without file storage add-ons, in this order: 1. Standalone CRM 2. CRM Plus and Zoho One DCs: All | Editions: All Available now for: - Standalone CRM accounts in Free and Standard editions without file storage
                                                                                                                      • Guide customers to the right booking page with routing forms

                                                                                                                        Greetings from the Zoho Bookings team! We're excited to introduce Routing Forms in Zoho Bookings. Routing forms let you collect information from customers before they schedule an appointment and automatically direct them to the most appropriate booking
                                                                                                                      • Cannot receive emails

                                                                                                                        Sent one days ago still no feedbacks, cannot call customer services number
                                                                                                                      • Email Password Reset - Vishal & shaik Vali Babu

                                                                                                                        Hi Team, The below-mentioned employees are unable to log in to their Gmail due to a password error. Kindly look into this on priority vishal.r@jumbotail.com shaik.babu@jumbotail.com
                                                                                                                      • Live Chat

                                                                                                                        Is live chat inthe website in zoho desk?
                                                                                                                      • Application-Level Save copy of sent emails

                                                                                                                        It would be really helpful to be able to turn on/off the Save copy of sent emails at a per application level, so some applications can save in the sent folder and others don't.
                                                                                                                      • DKIM 2048 too long

                                                                                                                        I'm trying to add a DKIM TXT record for my domain in Zoho Mail but my DNS provider (Shopify) has a character limit on TXT record values. The 2048-bit DKIM key is too long to enter. Can anyone advise how to generate a shorter 1024-bit key instead, or another
                                                                                                                      • Using IMAP configuration for shared email inboxes

                                                                                                                        Our customer service team utilizes shared email boxes to allow multiple people to view and handle incoming customer requests. For example, the customer sends an email to info@xxxx.com and multiple people can view it and handle the request. How can I configure
                                                                                                                      • Technical personnel are required to assist in synchronizing license quotas and solving the problem of being unable to add users.

                                                                                                                        We are a cross-border jewelry e-commerce company and currently use Zoho Mail Lite corporate email service. I have paid to purchase 1 Mail Lite annual user license (order number 133627785, payment time 2026-06-29). It has been more than 12 hours since
                                                                                                                      • non ricevo ne invio mail

                                                                                                                        non riesco ad inviare né ricevere posta. URGENTISSIMO
                                                                                                                      • 重要詢問:電子報回信沒有收到

                                                                                                                        我使用zoho作為寄電子報的mail, 但是我發現從電子報回信,完全都沒有收到!!!(包含垃圾郵件) kit那邊設定確定都沒有問題,請問這邊是哪裡設定有問題導致沒收到呢? (我確認過mail是一樣的)
                                                                                                                      • Mail Id’s backup

                                                                                                                        Dear Zoho Team, Kindly share the backup of my all mail id’s associated with Zoho account. Thanks, Saurabh Sharma +91 8851066915
                                                                                                                      • Feature Request - Option To Hide Default System Fields on Items

                                                                                                                        Hi Zoho Inventory Team, As far as I know it is not possible to hid some of the defult system fields on Items, such as UPC, MPN, EAN, ISBN. A good use case is that in many cases ISBN is not relevant and it would be an improved user experience if we could
                                                                                                                      • Important update on our transition to the new video platform framework

                                                                                                                        As part of our ongoing platform changes, users in select regions, including the United States and other supported data center locations, have been migrated to our new video platform framework. Due to this migration, some participants may notice changes
                                                                                                                      • Next Page