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




                                      Zoho Desk Resources

                                      • Desk Community Learning Series


                                      • Digest


                                      • Functions


                                      • Meetups


                                      • Kbase


                                      • Resources


                                      • Glossary


                                      • Desk Marketplace


                                      • MVP Corner


                                      • Word of the Day



                                          Zoho Marketing Automation


                                                  Manage your brands on social media



                                                        Zoho TeamInbox Resources

                                                          Zoho DataPrep Resources



                                                            Zoho CRM Plus Resources

                                                              Zoho Books Resources


                                                                Zoho Subscriptions Resources

                                                                  Zoho Projects Resources


                                                                    Zoho Sprints Resources


                                                                      Qntrl Resources


                                                                        Zoho Creator Resources



                                                                            Zoho Campaigns 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

                                                                                                    • PO receive limitations

                                                                                                      It is VERY common to receive more or less that the PO quantity. It's totally ludicrous to limit the maximum receive to the PO quantity! What if the receive is 0.00001 less than the PO quantity - it leaves the PO as "Partially received" The current options are to edit the PO manually before finalizing the receive, an outrageous situation ! Please Zoho guys - this is an infuriating oversight & can be easily resolved by introducing the option as shown in the attached document ......
                                                                                                    • How to view shared mailbox in Outlook

                                                                                                      How to view shared mailbox in Outlook or in another software
                                                                                                    • Document images

                                                                                                      We used to be able to rotate the images but this has now been removed ???
                                                                                                    • Request for Alerts on Workflow and Function Changes.

                                                                                                      I want to get an alert whenever a new workflow or function is added or an existing workflow or function is edited. Is there any way to do that? I need to log all changes whenever updates are made or new ones are added.
                                                                                                    • Why don't we have better integration with Mercado Pago or Pagseguro?

                                                                                                      Currently, the integration between Zoho Commerce and Mercado Pago for Brazil is very poor... Since it is old, it does not include the main payment method in Brazil today, which is PIX. Is there a date for this to finally be launched? There are numerous
                                                                                                    • Why is there no integration with native Brazilian shipping methods?

                                                                                                      Zoho Commerce is a powerful platform for e-commerce, but its lack of integration with native Brazilian shipping solutions is a significant limitation for users in Brazil. Integrating with popular shipping providers like Correios, Frenet, and Kangu would
                                                                                                    • Alert for Back Navigation in Zoho Creator Widgets on Mobile Apps

                                                                                                      In Zoho Creator widgets, when a user navigates back on mobile devices, the data within the widget is reset. This leads to a loss of any unsaved changes or inputs, causing frustration for users. To enhance user experience, we need to implement a confirmation
                                                                                                    • Mapping Zoho Projects into Cliq Channels

                                                                                                      why arent all the Zoho Projects listed from the drop down menu when trying to Map them into Zoho Cliq Channels. The system doesnt allow me to type the name of the project but gives a drop down of a list of projects however it doesnt give me a list of
                                                                                                    • Automatically assign Contacts to Account owners

                                                                                                      Hi, I have a finite number of accounts set up in the CRM, and each new contact that comes in is automatically assigned to an Account according to a rule I set up. I want the Contact owner in the Contacts module to be assigned to the relevant Account owner.
                                                                                                    • Input GST Reversal for damaged goods

                                                                                                      In our line of business, some items are damaged and we are doing inventory adjustments to remove them from stock. However, as per GST guidelines, there is a specific rule that we have to reverse Input GST availed for such items and needs to be reported
                                                                                                    • Develop and publish a Zoho Recruit extension on the marketplace

                                                                                                      Hi, I'd like to develop a new extension for Zoho Recruit. I've started to use Zoho Developers creating a Zoho CRM extension. But when I try to create a new extension here https://sigma.zoho.com/workspace/testtesttestest/apps/new I d'ont see the option of Zoho Recruit (only CRM, Desk, Projects...). I do see extensions for Zoho Recruit in the marketplace. How would I go about to create one if the option is not available in sigma ? Cheers, Rémi.
                                                                                                    • Tracking new lead response time

                                                                                                      Hi, I have a team of Sales Development Reps, who have a KPI of responding to a lead within 20 mins or less once it hits the system.  I seem to recall that Zoho CRM had the capability to track this in a previous version, but don't see it anywhere.   It's
                                                                                                    • Is there any way to prevent emails from being sent from zoho crm without pressing email opt out?

                                                                                                      When I left my desk yesterday I excitedly thought I had fixed my problem, by making use of the "Inactive" field ... However after contacting the support chat, they have advised to stop emails being sent I need to update the "Email Opt Out" field - which
                                                                                                    • Change work hours per day for employees

                                                                                                      Hello, Is there a way to modify the work hours per day for employees in Zoho projects? This would be helpful for resource allocation to more accurately see when an employee who works 35 hours a week vs 40 hours has a full schedule. Thanks.
                                                                                                    • 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
                                                                                                    • Unable to produce monthly P&L reports for previous years

                                                                                                      My company just migrated to Books this year. We have 5+ years financial data and need to generate a monthly P&L for 2019 and a monthly P&L YTD for 2020. The latter is easy, but I'm VERY surprised to learn that default reports in Zoho Books cannot create
                                                                                                    • Bulk Editing Multiple Invoices with Overwriting at time of upload

                                                                                                      Hello, I would like to edit a few 100 invoices. Only the HSN needs to be updated. When I am trying to upload the excel sheet with the data updated, I get an error: The Invoices are skipped as they already exist. I know the invoices exist but I would only
                                                                                                    • Change format of quantity format

                                                                                                      Hi,  I would like to change the qunatity format from 1,00 to 1.  Is this possible?   thanks!
                                                                                                    • Oauth Redirects me to sign in page

                                                                                                      I am developing a postman script for me to securely get my credentials via Zoho Vault. With that, I need to authorize my postman to be able to access Zoho Vault. I am currently on Step 1 in this Zoho Vault | API Reference which redirects me to this guide
                                                                                                    • Not able to change colors help center

                                                                                                      Hi. How can I change the orange color in the help center? You can change everything besides this font color And how can I remove the part on the bottom?
                                                                                                    • Here's why you should refrain from using EasyShip

                                                                                                      This is a screen recording which shows EasyShip performance issues. Note well! While we do use the Zoho-to-Easyship integration, the problems are wholly on the EasyShip side. The actual integration of data to EasyShip, and status updates back to Inventory,
                                                                                                    • How can I create a billable expense.?

                                                                                                      Hi, I've a bill of an expenses related to printing and stationary account but it recorded in non-billable expense category. How can I record this expense in billable category. Below is the pathway I've used to record the expense. Purchases. Expenses Click
                                                                                                    • Introducing Sub-Accounts in Zoho Books!

                                                                                                      Hello Everyone, Sub-Accounts is LIVE! Yes, you read it right. The much needed and most requested feature is now live in Zoho Books. The sub-accounts feature in Zoho Books will help you to classify your accounts further which will give you a more detailed view of your accounts while running reports. You can create sub-accounts for the below Accounts: Asset Cost of Goods Sold Expense Liability Fixed Asset Other Asset Other Current Asset Long Term Liability Other Current Liability Other Liability Other
                                                                                                    • How can I insert and update field data of a sub-form without adding data into the main form’s mandatory fields.

                                                                                                      1. I have a main form that contains a sub-form. I need to update the data of the sub-form from a function, but I am unable to do so. How can I achieve this in Zoho Creator? 2. How can I insert data into a sub-form without inserting data into the mandatory
                                                                                                    • How to autorespond for inactive users?

                                                                                                      Hi, we have a few inactive users that we would like to set up an autorespond to the sender telling that the email addresses are no longer active. How can we do that?
                                                                                                    • Cannot view or interact with polls on IOS

                                                                                                      When testing with Android the user will receive a pop up message when a poll is started and be able to access polls via the more menu. This is not the case when using IOS phones, there seems to be no way to view or interact at all.
                                                                                                    • Calendar view not working in Zoho Projects

                                                                                                      Hello Zoho team! Since this morning, clicking on the "Calendar" link in the Projects Menu doesn't do anything. It seems to refresh the page, but it doesn't open the calendar view for tasks. It affects every user in my company. Closing and opening the
                                                                                                    • Multi Select Filter off comma separated values

                                                                                                      Hey friends! I have a query table for a couple of dashboards/ charts. In one of the dashboards, I'm trying to create a multi select filter for the service that is being sold. The way we look at services is by a CRM field titled, "Mail Lead Entities,"
                                                                                                    • Dashboard filter applied to all reports but not visible on report

                                                                                                      Hi, I have two reports which shows sales transactions data - one is graph and the other a pivot table. Both reports use the same base table. There are no filters on the reports so it shows all transactions for the last 6 months. I want to create a dashboard that includes the graph and the pivot table report. However, I want the dashboard to have a fixed date filter that only shows the last 30 days of data i.e. filtering the underlying graph and pivot table to show the last 30 days of order data.
                                                                                                    • Equipment Scheduling for Efficient Field Service Operations

                                                                                                      Zoho FSM helps you nail the critical aspect of field service management, i.e., scheduling the right technicians to the service appointments. Ensuring that technicians have access to the right tools and machinery for their job is also of paramount importance.
                                                                                                    • Chat issues

                                                                                                      I am having a couple problems with the zoho chat feature. When I use Chat from the App bar, not everyone is getting messages (these are to different accounts, Yahoo & Gmail). I did finally get the Users to show up correctly. However, when in an active chat with someone, I only get one sound notification. No other notifications, pop up or otherwise, come through to alert if another message was sent. Also, the bottom Chat bar that shows Active chats while I am in email does not show any online contacts
                                                                                                    • Problem with multiple pages record template

                                                                                                      Hi, I have a record template with multiple pages. When I print, it has gaps between pages. How can i fix it?
                                                                                                    • Field Update: can't find a custom multi-line text field in the options list

                                                                                                      I want to update a custom text field (large size multi-line: 32000 characters) that I have added in the Accounts module using this functionality https://help.zoho.com/portal/en/kb/crm/automate-business-processes/actions/articles/field-updates , but I
                                                                                                    • Ask the experts - A live Q & A discussion on Zoho Recruit

                                                                                                      We are delighted to come back with another edition of Ask the Experts community series. This edition, we'll be focusing on everything about Zoho Recruit. The topics will focus on the features that are used/asked by the majority of users and also based
                                                                                                    • No Sales Returns on SO's with Dropped Shipped items + Inventory Items

                                                                                                      We have encountered an issue in Zoho related to sales orders that include both dropshipped items and inventory items. Specifically, it is currently not possible to create sales returns for the company’s own inventory items from these sales orders. This
                                                                                                    • Task Due dates and Reminder Date & Time

                                                                                                      I like to have a reminder on many tasks in Zoho Recruit. I find the process cumbersome in that each task requires the following: 1. click and select due date 2. Click the reminder box 3. Click on (Reminder) Start Date 4. Click on (Reminder )Time If one
                                                                                                    • Bug - OTP (email) and No Duplicates

                                                                                                      Scenario: Form with an email field, Validation: "No Duplicates" (because I want to ensure 1 entry per email). Embedded form into website (JS option). Enabled email based OTP. 1st test (via my website) - entered my email address - sent OTP - entered pin,
                                                                                                    • Zoho One Datensicherung möglich

                                                                                                      Gibt es eine Zoho One Datensicherung über alle Apps mit eindeutigen Datensatz-Id´s eines Kontaktes in allen Apps und mit allen Bildern (insbesondere Artikel-Bilder)? Wir haben festgestellt, dass die Zoho Books Datensicherung keine Bilder sichert. Und
                                                                                                    • Note not being pulled for other modules in email template

                                                                                                      Hi there, Currently i am creating an email template that is able to pull the data from notes field in estimate module and email it to procurement team where they will be able to receive the email with the contents of the note, i am unable to replicate
                                                                                                    • Pop Up

                                                                                                      Hello, I want to automatically display the information of the attached data in the product module in the related list section of my data in the lead module when the current time matches the "Call Time" field of my data in the leads module. How can I achieve
                                                                                                    • Next Page