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!

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



          • Recent Topics

          • A quicker way to provide accountants access to Zoho Books, similar to Xero and Quickbooks

            Hey guys, I'm finding the procedure to give access to an external accountant to Zoho Books less than ideal. Having to create an account by Zoho instead of myself, and then wait for it to be given a license to then pass to the accountant seems a bit time
          • Upgraded to Zoho One but Zoho Meeting still says Free Plan

            I signed-up for the Zoho One plan. When exploring the applications included, I came across a problem with Zoho Meeting. It says it's the free plan. I emailed support but they sent me a link that doesn't work and, when I found the article on my own, it
          • This user is not allowed to add in Zoho. Please contact support-as@zohocorp.com for further details

            Hello, Just signed up to ZOHO on a friend's recommendation. Got the TXT part (verified my domain), but whenever I try to add ANY user, I get the error: This user is not allowed to add in Zoho. Please contact support-as@zohocorp.com for further details I have emailed as well and writing here as well because when I searched, I saw many people faced the same issue and instead of email, they got a faster response here. My domain is: raisingreaderspk . com Hope this can be resolved.  Thank you
          • Self Client Authorization Issue

            Hi. Trying to test the api integration for Zoho Desk with the Self Client - Client Credintials flow method. I've created the self client, obtained the client id and secret, inputted "Desk.tickets.ALL" as my scope, and "ZohoDesk.[My Zoho Desk Org ID]"
          • Update Candidate Status Through Workflow in Blueprint

            Hi Team,  We have a blueprint built out with custom functions that update particular fields based on candidate actions. When particular fields are updated we need to move the candidate forward in the blueprint. We tried to do this through a workflow,
          • Zoho Canned respond do have a huge lag issue.

            Previously the Zoho canned respond works perfectly ... on once server update and all the Canned respond enconter huge lag... in the end cause most of the canned respond just shown code with /xxx and not the sentence....
          • Pay Contractor Timesheets

            I have contractors that fill out a timesheet. Each hour must be assigned to a current client. I need the easiest way to get the contracts paid. They are paid on an hourly bases. How can this be done?
          • Select CRM Custom Module in Zoho Creator

            I have a custom module added in Zoho CRM that I would like to link in Zoho creator.  When I add the Zoho CRM field it does not show the new module.  Is this possible?  Do i need to change something in CRM to make it accesible in Creator?
          • ShipStation and Zoho Inventory

            Hello, I am looking to sync zoho inventory with shipstation ZOHO INVENTORY           SHIP STATION Sales Order  ==>  create ORDERS INVOICE  <==    Shipments What exactly does BETA mean on the Shipstation connector?  This is required for me to sign-on in the next month. Thanks in advance for your efforts
          • Saving slide elements

            I have created grouped items including text and animation that I want to use in later slides. (Like an animated logo) Is there a way to save these grouped elements in my library?
          • Are downloadable product available in Zoho Commerce

            Hi all. We're considering switching to Zoho Commerce for our shop, but we sell software and remote services. Is there a features for downloadable products? I can't find any information about this. Thank you very much Alice
          • Function #10: Update item prices automatically based on the last transaction created

            In businesses, item prices are not always fixed and can fluctuate due to various factors. If you find yourself manually adjusting the item rates every time they change, we have the ideal time-saving solution for you. In today's post, we bring you custom
          • Writing on sketch cards is bugged when zoomed in

            When zoomed in, it writes a noticeable distance above or to the side of where you're actually trying to write. The further you're zoomed in, the more noticeable it is. Zooming is also entirely absent on the desktop version.
          • Move site from WIX to ZOHO Sites

            I have a simple website on WIX.  I am wondering if someone is available to help me move this website - https://www.videothreezero.com/ to ZOHO.  Michael  Boston
          • Move a Contact from Current Account to a NEW Account

            I do not believe the functionality to Move a Contact from a Current Account to a New Account is not available. Please someone tell me I am missing something! I have been through designing, developing, using and selling CRM systems for over 25 years and had this functionality20+ years ago in other CRMs.  In the real world people move from one organisation to another. In the sales, finance and technical world it is nice to see the communication history with that person in their old account and also
          • 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.
          • Zoho CRM Automation Help: Send Email When Fault is Marked as Done & Module Relationships

            Hi everyone, I have the following User-Created Modules in Zoho CRM: Clients Assets Faults Handymen Every client can have multiple assets. Every asset can have multiple faults. Every fault is assigned to one handyman. What I Want to Achieve: ✅ I want to
          • Adding New Domain to Zoho mail

            Hi, I have one Zoho account already called for example "Awesome Animals". Under this account I have one domain already setup with zoho mail, example: - awesomecats.com I have another website as well which I want to add under this "Awesome Animals" account,
          • I cannot receive emails.

            I need help, I've tried everything but I still can't receive emails from other people. I can send it but I can't receive emails, When I created the email it was all in order and suddenly I can't get emails from anyone anymore.
          • Incoming Gmail Email Not Coming Into Zoho

            My outbound email from Zoho is working, but when people respond to the email, it's not coming back into Zoho. I can see it when I'm in Gmail, but it's not in Zoho.
          • Não foi possível enviar a mensagem;Razão:554 5.1.8 Email Outgoing Blocked.

            Preciso de ajuda não consigo enviar emails,conta recen criada
          • Request to Customize Module Bar Placement in New Zoho CRM UI

            Hello Support and Zoho Community, I've been exploring the new UI of Zoho CRM "For Everyone" and have noticed a potential concern for my users. We are accustomed to having the module names displayed across the top, which made navigation more intuitive
          • Expand Zia's Language Support and AI Capabilities

            Dear Zoho Desk Support, I would like to submit a feature request to improve Zia, the AI-driven support assistant in Zoho Desk. Currently, Zia only supports the English language, while other AI agents such as Gemini, ChatGPT, and Claude can work with a
          • Average Costing / Weighted Average Costing

            Hello fellow maadirs. I understand Zoho Books uses FIFO method of dealing with inventory costing, but do you guys have any plans to introduce average costing? We indians need average costing. It's part of our culture. Please. I beg thee. Thanks.
          • Links in Instagram

            Hi there, I have been using Later for a while now but keen to come back to Zoho Social as Later doesn't offer tagging of pages on Facebook but they offer something Zoho doesn't. You can add a link to your bio which opens up your profile feed where images
          • Zoho Social integration with Zoho Flow

            Is there any plans for Zoho Social integration with Zoho Flow?
          • Unable to push Contact Score to CRM as shown in documentation

            Hello: According to the documentation found on the link below, which specifically states this is for the new CRM-Campaigns integration model, there is an option to push Contact scores in Campaigns to a field in the CRM. For reference, I have included
          • Adding tag to specific record as an acion in a workflow

            Hi! I've created the following workflow in the module 'Leads'. When a record meets the criteria, there should be a tag added to the specific record in the module 'Contacts'. In the module 'Leads', there is a look-up field named 'Kandidaat' which is connected
          • How to query for Deals record based on Pipeline?

            I want to query for Deals records that matches a specified Pipeline using a Deluge function. When I call zoho.crm.searchRecords("Deals","(Pipeline:equals:" + myPipeline + ")"), I get this error: { code: 'INVALID_QUERY' , details: {...} , message: 'Invalid
          • CRM formula field help

            Hello! i was hoping to get some help with a formula i'm creating within a module. I'm looking to make a formula that changes based on a date field but based upon the present date. This is the formula i have so far: If(Now() < ${Instructors.Start Date},
          • Change to copy/paste functionality in Deluge code editor

            Recently there was a change to the Deluge code etidor where it now inserts backslashes into strings automatically when copying/pasting strings with double quotes, it's a nightmare to have to go delete all these. Is it possible to toggle this on or off?
          • ChatGPT only summarize in English

            Hello i' v enabled chatgpt in salesIQ, it works great inside conversation (revise, Rephrase etc) add tags works well with another language than English. But when I want to summarize it render only in English, despite sales IQ is set to another language.
          • Chart with Filtered Data vs Unfiltered Data

            I am looking to create a chart view that displays the full data set vs a subset of the data filtered by user filter. However I do not seem to find any method by which to exclude a plot from the applied filter or any other method by which to display the
          • BIN Locations

            Hi, I’m new to Zoho inventory and unless Im missing something, I cannot find BIN locations anywhere in ‘items’? please tell me it’s there somewhere?!? Thanks
          • BANK FEED - MAYBANK , provider from YODLEE IS NOT WORKING

            As per topic, the provider YODLEE is not working for the BANK FEED. It have been reported since 2023 Q3, and second report on 2023 Q4. now almost end of 2024 Q1, and coming to 2024 Q2. Malaysia Bank Maybank is NOT working. can anyone check on this issue?
          • Create a custom button to modify custom fields in zoho Inventory

            I am needing a script for two buttons, 1. Button will add todays date to a custom field named cf_sent_to_sov 2. Button will mark a checkbox or unmark a checkbox field named cf_parts_ordered I have been trying to figure out deluge but have not got anywhere
          • Canadian payroll

            Hello ZOHO, is any updates on when payroll for Canada will be available?
          • Update Department on Ticket (with applied Blueprint)

            Hello, Is it possible to update the Department of a ticket which is dictated by a blueprint, e.g. I would like to change departments at different states in the Blueprint. I do not see this is an option in workflow rules or blueprint transition actions,
          • in zoho assist I would like to temporarliy go into view only mode

            During a zoho assist remote support / remote control session, I would like an option to turn off control, and go into view only mode. Then later, turn back on control, all within the same session. (Many other remote login apps have this feature.) For
          • Issue Configuring SSO Integration with Cognito in Zoho Help Center

            Dear Zoho Support Team, We have been working on configuring SSO integration for our Zoho Help Center using Amazon Cognito. While the setup appears to be completed successfully, we are encountering an issue when attempting to access the Help Center. The
          • Next Page