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







                              Zoho Developer Community





                                                    Use cases

                                                    Make the most of Zoho Desk with the use cases.

                                                     
                                                      

                                                    eBooks

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

                                                     
                                                      

                                                    Videos

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

                                                     
                                                      

                                                    Webinar

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

                                                     
                                                      
                                                    • Desk Community Learning Series


                                                    • Meetups


                                                    • Ask the Experts


                                                    • Kbase


                                                    • Resources


                                                    • Glossary


                                                    • Desk Marketplace


                                                    • MVP Corner




                                                              • 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


                                                              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 Writer

                                                                                                Get Started. Write Away!

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

                                                                                                  Zoho CRM コンテンツ








                                                                                                    Nederlandse Hulpbronnen


                                                                                                        ご検討中の方




                                                                                                              • Recent Topics

                                                                                                              • how to differentiate if whatsapp comes from certain landing page?

                                                                                                                I create a Zobot in SalesIQ to create a Whatsapp bot to capture the lead. I have 2 landing pages, one is SEO optimized and the other want is optimized for leads comes from Google Ads. I want to know from which landing page this lead came through WhatsApp
                                                                                                              • Collaps Notes

                                                                                                                There are times when long/large notes are added to a record i.e. Accounts or Deals etc. Currently, the full note is displayed in the notes related list section. It would be great if by default only 5 to 10 rows of the note are displayed when the note
                                                                                                              • Zoho Down

                                                                                                                I have a drop in my Zoho One services.
                                                                                                              • Runing RPA Agents on Headless Windows 11 Machines

                                                                                                                Has anyone tried this? Anything to be aware of regarding screen resolution?
                                                                                                              • Problem for EU users connecting Zoho CRM through Google Ads for Enhanced conversions

                                                                                                                Has anyone else experienced this problem when trying to connect Zoho CRM through Google Ads interface to setup enhanced conversions? Did you guys get it fixed somehow? The Problem: The current Google Ads integration is hardcoded to use Zoho's US authentication
                                                                                                              • Rich Text For Notes in Zoho CRM

                                                                                                                Hello everyone, As you know, notes are essential for recording information and ensuring smooth communication across your records. With our latest update, you can now use Rich Text formatting to organize and structure your notes more efficiently. By using
                                                                                                              • Whatsapp Limitation Questions

                                                                                                                Good day, I would like to find out about the functionality or possibility of all the below points within the Zoho/WhatsApp integration. Will WhatsApp buttons ever be possible in the future? Will WhatsApp Re-directs to different users be possible based
                                                                                                              • Issue with Inline Images in Email Reply via Zoho Desk API

                                                                                                                Hi, I am attempting to send inline images in an email reply using the Zoho Desk API, but the images are not being displayed inline for the recipient. I have followed this documentation: https://desk.zoho.com/DeskAPIDocument#Uploads https://desk.zoho.com/DeskAPIDocument#Threads#Threads_SendEmailReply
                                                                                                              • How to overcome limitations in meetings

                                                                                                                As a company, one of our deliverables is a meeting between two other companies, where we act as facilitators. So, if we recorded this meeting  in Zoho CRM, it should be connected to 2 accounts, 2 contacts, and 1 campaign (a campaign, in our use, is the
                                                                                                              • India Tech Support

                                                                                                                Is there no phone tech support number for India? And no chat facility either?
                                                                                                              • Billing Management: #1 Billing an Universal Business Routine

                                                                                                                Hello, As the saying goes, "Do the hardest job first", we started with the complex subject in finance, revenue management, which is considered to be the backbone for any business. Now, let's shift our focus and take a deep dive into this Billing Management
                                                                                                              • Show/ hide specific field based on user

                                                                                                                Can someone please help me with a client script to achieve the following? I've already tried a couple of different scripts I've found on here (updating to match my details etc...) but none of them seem to work. No errors flagged in the codes, it just
                                                                                                              • What is a a valid JavaScript Domain URI when creating a client-based application using the Zoho API console?

                                                                                                                No idea what this is. Can't see what it is explained anywhere.
                                                                                                              • Field Dependency Not Working on Detail Page in Zoho Desk

                                                                                                                Hi Support Team, I’ve created field dependencies between two fields in Zoho Desk, and they are working correctly on the Create and Edit layouts. However, on the Detail page, the fields are not displaying according to the dependencies I’ve set — they appear
                                                                                                              • Zoho CRM button to download images from image upload field

                                                                                                                Hello, I am trying to create a button in Zoho CRM that I can place in my record details view for each record and use it to download all images in the image upload fields. I tried deluge, client scripts and even with a widget, but feel lost, could not
                                                                                                              • 5名限定 課題解決型ワークショップイベント Zoho ワークアウト開催のお知らせ (9/25)

                                                                                                                ユーザーの皆さま、こんにちは。Zoho ユーザーコミュニティチームの藤澤です。 9月開催のZoho ワークアウトについてお知らせします。 今回はZoomにて、オンライン開催します。 ▷▷参加登録はこちら:https://us02web.zoom.us/meeting/register/6OSF2Bh6TumsMIlDwaY_PQ ━━━━━━━━━━━━━━━━━━━━━━━━ Zoho ワークアウトとは? Zoho ユーザー同士で交流しながら、サービスに関する疑問や不明点の解消を目的とした「Zoho
                                                                                                              • Try FSM again for our business

                                                                                                                We already have our customers individual equipment in CRM with serial numbers, install dates, warranty length and importantly next service which is generally 2 years. a month before the service date is due we get get a report and send out service reminders.
                                                                                                              • Introducing Assemblies and Kits in Zoho Inventory

                                                                                                                Hello customers, We’re excited to share a major revamp to Zoho Inventory that brings both clarity and flexibility to your inventory management experience! Presenting Assemblies and Kits We’re thrilled to introduce Assemblies and Kits, which replaces the
                                                                                                              • Customer Parent Account or Sub-Customer Account

                                                                                                                Some of clients as they have 50 to 300 branches, they required separate account statement with outlet name and number; which means we have to open new account for each branch individually. However, the main issue is that, when they make a payment, they
                                                                                                              • Prevent stripping of custom CSS when creating an email template?

                                                                                                                Anyone have a workaround for this? Zoho really needs to hire new designers - templates are terrible. A custom template has been created, but every time we try to use it, it strips out all the CSS from the head.  IE, we'll define the styles right in the <head> (simple example below) and everything gets stripped (initially, it saves fine, but when you browse away and come back to the template, all the custom css is removed). <style type="text/css"> .footerContent a{display:block !important;} </style>
                                                                                                              • Workdrive 5.0 / API Documentation Workflows

                                                                                                                Hi Zoho, When will the API documentation of the workflows be published? We are interested in using it to trigger manual workflows from an external application. Greetings, Justin
                                                                                                              • Error: Unsupported content type: text/html;charset=UTF-8 after tryeing to get the token for n8n automation

                                                                                                                I am working on ZOHO Desk automation and need to get the ZOHO auth token for n8n I have created the app in ZOHO Desk API, got client id and client secret. Added all data required to get a token in n8n. After I sign in with my ZOHO credentials in ZOHO
                                                                                                              • Replace Lookup fields ID value with their actual name and adding inormation from subforms

                                                                                                                Hi everyone,  I wanted to see if someone smarter than me has managed to find any solutions to two problems we have. I will explain both below.  To start we are syncing data from Zoho CRM to Zoho Analytics and I will use the Sales Order module when giving
                                                                                                              • Webhook from Zobot to Zoho Flow fails

                                                                                                                I'm trying to connect from zobot to zoho flow. When testing in zflow, I am receiving all entered data from the connector correctly. The SalesIQ connector's "outputreaction" is {} (is this normal or is there a problem?). But as soon as I try my chat bot
                                                                                                              • Transition from Sole Proprietorship to GmbH (Limited Liability Company) – Best Approach in Zoho Books / Zoho One

                                                                                                                Hello everyone, I am currently operating under a Zoho One plan with a sole proprietorship in Switzerland. As of January 1st, 2026, I will be incorporating a new legal entity – a GmbH (Swiss equivalent of a Limited Liability Company). While the business
                                                                                                              • Presenting ABM for Zoho CRM: Expand and retain your customers with precision

                                                                                                                Picture this scenario: You're a growing SaaS company ready to launch a powerful business suite, and are looking to gain traction and momentum. But as a business with a tight budget, you know acquiring new customers is slow, expensive, and often delivers
                                                                                                              • Best way to display complex Bookings Consultation Descriptions on Zoho Site?

                                                                                                                I am a new user so apologies if this has been asked before. I couldn't find any answers in the forum. We offer 18 complex Consultations to our subscribers. Our current platform lets me put detail on these Consultations thoroughly (200-300 words) during
                                                                                                              • No Response from Zoho Support in 8 Days - Typical?

                                                                                                                I have a couple of issues I'm trying to work through. Initially, I was getting support from support@zohofsm.com, but I have not received a response in 8 days (11 on another question). Is this typical? Can I pay for support? For context, I am not spamming
                                                                                                              • Cliq iOS can't see shared screen

                                                                                                                Hello, I had this morning a video call with a colleague. She is using Cliq Desktop MacOS and wanted to share her screen with me. I'm on iPad. I noticed, while she shared her screen, I could only see her video, but not the shared screen... Does Cliq iOS is able to display shared screen, or is it somewhere else to be found ? Regards
                                                                                                              • Age Calculation

                                                                                                                I've attempted to calculate the age of someone based on their birthday input by using the formula field. It works but I don't want all those decimals on there. I then tried to use "set variable" after birthday input but I get a field type mismatch, long vs. floating. Any ideas would be wonderful.
                                                                                                              • Access Denied

                                                                                                                I am iOS Developer and updating our clients project and shifted ZohoDeskPortalCore SDKs from cocoapods to SPM and changed few lines of code but now i am get access denied, the help center app is unavailable. please contact administrator.
                                                                                                              • Using Zoho Desk to support ISMS process

                                                                                                                Hi, I am evaluating using Zoho Desk for security incident management. This seems to be aligned with Zoho Desk purpose as its just another type of incident. However in security incident management, ideally I can link incidents (tickets) with a risk from
                                                                                                              • Filtering Tickets based on Email headers

                                                                                                                We're starting to get a lot more junk coming into our Zoho Desk, which is then triggering unnecessary email alerts to agents. Once thing we could do to cut this junk in half, is to filter tickets based on email headers. Any email containing the `List-Unsubscribe`
                                                                                                              • TaxJar vs Avalara

                                                                                                                Hi, I'm evaluating adoption of a sales-tax service for US based business. Anyone else have experience with TaxJar and Zoho Books? I am a Zoho One subscriber so anticipate needing to use Flow to make this work. It seems like Avalara are simply too expensive
                                                                                                              • How to check Leads with no Task (open activity)

                                                                                                                Hi everyone, I was wondering if there’s a way to view leads that don’t have any tasks assigned or open activities linked to them.
                                                                                                              • What can we do on our end to improve the Answer bot answers?

                                                                                                                Hi, I'm using the Answer bot card in the Codeless bot builder. I've input several questions and their answers in the FAQ section to feed the Answer bot. The text is all in French, as this is the language our customers communicate in. I've tried testing
                                                                                                              • Zoho Books Sandbox environment

                                                                                                                Hello. Is there a free sandbox environment for the developers using Zoho Books API? I am working on the Zoho Books add-on and currently not ready to buy a premium service - maybe later when my add-on will start to bring money. Right now I just need a
                                                                                                              • Taxes for EU B2B Transactions

                                                                                                                Currently, ZC doesn't seem to have a procedure for validating VAT numbers of businesses purchasing in another EU state, and removing local VAT is valid.  This is essential for all inter EU B2B trade.
                                                                                                              • How to upload file to Connect using API?

                                                                                                                Hi there. I looked at the API documentation and nowhere did it mention how to use the API method to upload a file even though it is mentioned that it is possible to be done so. Please help.
                                                                                                              • 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?
                                                                                                              • Next Page