Kaizen 250: Introducing write-enabled Queries: Auto-populating lookup fields

Kaizen 250: Introducing write-enabled Queries: Auto-populating lookup fields


Hello Everyone,

Welcome back to an exceptional edition of the Kaizen series!
Today marks Kaizen #250, an exciting milestone in our journey of exploring, learning, and building with Zoho CRM. Over the past 249 editions, we've covered a wide range of features, APIs, best practices, and real-world use cases designed to help you get more out of Zoho CRM. A heartfelt thanks to everyone who has followed the series, shared feedback, asked thoughtful questions, and supported this journey along the way.

In today's post, let's explore the latest enhancements to Queries.


Until now, we've primarily used Queries as a read-only capability allowing us to fetch data, transform it using a Serializer, and display it in components such as Canvas and Kiosk. However, whenever we had to update a CRM record, such as setting a lookup field or modifying a value we had to rely on Custom Functions or Client Scripts. 

Info

What's new

Query Workbench's REST API source type supports GET, POST, PUT, PATCH, and DELETE, which means a Query can now perform the write itself, end-to-end.

Why this matters

The latest enhancement to the Queries feature enables you to automate dynamic lookup assignments directly within Zoho CRM. In this post, we'll use a practical example to show how this enhancement works in a Blueprint-driven Kiosk flow.
Quote

Business scenario

Zylker Field Services manages a team of Field Engineers across multiple service zones. Whenever a new Service Application is created, a dispatcher is responsible for manually identifying the most suitable engineer by matching the application's Zone and Specialization, and selecting the engineer with the lowest Active_Request_Count before assigning the request.

The Operational Problem

Traditionally, this process is manual:
  1. The dispatcher opens the Field Engineers module.
  2. Filters engineers by the required Zone and Specialization.
  3. Compares each engineer's Active_Request_Count.
  4. Assigns the engineer with the lightest workload.
This approach is both time-consuming and difficult to scale. As the number of service requests and engineers grows, manually comparing workloads becomes inefficient and can lead to uneven distribution of work.
Idea

Solution Overview

To automate engineer assignment, we'll build a Kiosk that is triggered from the Assign Engineer Blueprint transition. The Kiosk uses GetRecords state to retrieve the most suitable engineer and update the required records directly through the Queries with Zoho CRM REST API source.

The solution works as follows:
  1. The Kiosk is launched when the Service Application enters the Assign Engineer Blueprint transition.
  2. The GetRecords state fetches the Field Engineers module for engineers who match the Service Application's Zone and Specialization, filters only active engineers, and sorts the results by Active_Request_Count in ascending order.
  3. If a matching engineer is found, the Kiosk, updates the Field_Engineer lookup field on the Service Application by invoking the Query.
  1. Finally, the Kiosk displays a confirmation message and completes the Blueprint transition.

  2. If no suitable engineer is found, the Kiosk notifies the dispatcher, preventing the transition from completing until the assignment can be handled manually.

This approach ensures that every Service Application is assigned to the best-fit, least-loaded engineer while keeping the implementation entirely within native CRM components. 

Implementation

Step 1: Create a Query to Update the Field Engineer Lookup in Service Application Module

  1. Navigate to Setup -> Developer Hub -> Queries.
  2. Click Create Query, provide a name, and click Next. 
  3. In the Query Workbench, select Zoho CRM REST API as the Source. 
  4. Set the Request Method to PUT. 
  5. Specify the relative path for the Update Records API, passing the Service Application record ID as a variable. 
    /v8/Service_Applications/{{service_record_id}}

  6. Select Raw as the Body Type.
  7. Enter the following request body. The Kiosk dynamically populates the lookup field values. 
    {
     "data": [
     {
     "id": "{{service_record_id}}",
     "Field_Engineer": {
     "id": "{{engineer_id}}",
     "name":"{{engineer_name}}"
     }
     }
     ]
    }

  8. Provide the code to the Serializer to format the response according to your requirements. If the result contains data it will return "Field Engineer Assigned".
    const apiResult = result?.data?.[0] ?? {};

    return [{
     Message: "Field Engineer Assigned" ?? "Engineer Lookup Field Update Failed"
    }];

  9. Click Execute Query to verify the request and Save the Query.
      

Step 2: Create a Kiosk to Retrieve and Assign the Field Engineer

Create a Kiosk that retrieves the most suitable engineer and updates the Field_Engineer lookup field during the Blueprint transition.
  1. Navigate to Setup -> Customization -> Kiosk Studio
  2. Click Create Kiosk
  3. Provide a name and click Next
  4. Select Service Applications as the current module.


Add a Get Records state

  1.  Add a Get Records state and name it Get Suitable Field Engineer. 
  2.  Associate the Query that retrieves Field Engineers based on:
    1.  Zone 
    2.  Specialization 
    3.  Active status 
  3. Sort the results by Active_Request_Count in ascending order so that the least-loaded engineer is returned.  

Add a Decision state

  1.  Add a Decision state after the Get Records state. 
  2.  Name the decision Engineer Found. 
  3.  Configure the condition to check whether the Query returned a matching engineer. 
  4.  Create two paths: 
    1. Assign Engineer
    2. Default


Configure the Assign Engineer path

  1.  Add a Screen to the Assign Engineer path. 
  2.  Click Add and select Get data via Queries. 
  3.  Click New Query and associate the Query created in Step 1. 
  4. Map the required variables from the Get Records response and the current record. 
  5.  Select the fields to display on the screen. 
  6.  Click Save, and then Done

Configure the Default path

  1.  Add another Screen to the Default path. 
  2. Display an appropriate message, for example: "No matching service engineer is currently available. Please assign an engineer manually to continue".
  3.  Click Publish to save the Kiosk.

Step 3: Associate the Kiosk with the Blueprint Transition

Associate the Kiosk with the Assign Engineer Blueprint transition so that it is launched automatically whenever the transition is executed.
  1. Navigate to Setup > Process Management > Blueprint.
  2. Open the Blueprint created for the Service Applications module.
  3. Select the Assign Engineer transition.
  4.  Click Add(+) in the During tab.
  5. Choose Kiosk from the list of associated items.
  6. Select the Map Service Engineer Kiosk that you created in the previous step.
  7. Save the Blueprint.



The Outcome

When a user creates a Service Application, the record is initially created in the Open state. The Assign Engineer Blueprint transition is then available for execution. When the user clicks the Assign Engineer transition, the associated Kiosk launches automatically. The Kiosk retrieves the most suitable Field Engineer based on the application's Zone and Specialization, updates the Field_Engineer lookup field on the Service Application, and completes the assignment. If no matching engineer is found, the Kiosk displays an appropriate message, preventing the transition from proceeding until the assignment is handled manually.

We hope you found this post useful. 
We would love to hear from you! Write to us at support@zohocrm.com.

Happy Querying!




    • 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
    • Recent Topics

    • Unable to view existing or create new WhatsApp IM templates on Zoho Desk

      Hi there, Is there a issue with WhatsApp templates in Zoho Desk currently [17 Aug 2026]? I am unable to view existing or create new WhatsApp IM templates. It's saying "Oops, something went wrong. Please try again later."
    • ´´Send Email Reply´´ action does not work when the message body contains placeholders.

      Hi Community, I am working on a workflow where the Customer contact is notified via email when their ticket status goes On Hold. To do that, I chose the Send Email Reply action, and the minute I add a placeholder, the workflow does not work and the ticket´s
    • About products & categories URL

      hello guys, I'm trying to migrate date from Magento 2 to Zoho Commerce and I have some doubt about URL. In my M2 for product I have "Url Key" field with value like this: "product-url" and page appear like this: "www.sitename.com/product-url.html" In ZC
    • Which Zoho CRM tasks would you want an AI assistant to handle?

      I’ve started delegating my Zoho CRM work to AI – and many tasks now take me half the time. It has been so useful that we’re now working to make it available to everyone. Instead of clicking through records and tabs, I simply describe what needs to be
    • Is Zoho Assist Secure Connect even practical for 1 person shop?

      I was gun ho with Zoho Assist to replace my existing Remote Access product I have been using but I need to implement MFA on each unattended connection. Right now each of these connections in my other product has a rotating token that I have enter off
    • Export Campaign to another document?

      How can I export my Campaign to Word and PDF? I want to create a PDF archive on my website with old campaigns /Peter
    • Filter isn't

      The ability to filter the history of a given flow to a specific status however it would be great to have the ability to filter to a status that isn't something for example if i want to find all history that isn't complete.
    • Zoho CRM Functions: Redesigned Interface, Rich Analytics, and Multi-Language Support

      Hello everyone! We have given Functions in Zoho CRM a major overhaul with a new interface that makes it easier to build, organize, monitor, and troubleshoot your functions throughout their lifecycle. As part of this revamp, we have also introduced a unified
    • WhatsApp Calling Integration via Zoho Desk

      Dear Zoho Desk Team, I would like to request a feature that allows users to call WhatsApp numbers directly via Zoho Desk. This integration would enable sending and receiving calls to and from WhatsApp numbers over the internet, without the need for traditional
    • Gemini Action - Add "inineData" Support

      Thank you guys for adding a Gemini action. I like Gemini models for the "grunt work" of AI, as they have the cheapest tokens of the trustworthy providers One thing that's missing in the action, though, is the ability to pass file data. If you pass a base64-encoded
    • LinkedIn RSC is now live in Zoho Recruit

      LinkedIn Recruiter System Connect (RSC) is here. Your Zoho Recruit data (candidates, jobs, notes, stage updates, resume attachments, and more) now syncs with LinkedIn in real time. Note: LinkedIn RSC is included with your LinkedIn Recruiter Corporate
    • What's New in Zoho Inventory | April & May 2026

      Hello users, We're excited to roll out the latest Zoho Inventory updates for April and May 2026. These enhancements are designed to make your daily operations smoother and more efficient, from advanced inventory management and flexible pricing to automated
    • Old Gmail inbox migration to Zoho mail

       Hi, I have been checking Zoho products for a while. This week finally decided to migrate my company mail accounts from Gmail to Zoho. I was looking for sometime and could not found a way to perform this; only found the way to take a backup of my old account into Zoho connecting throught pop3 server; but I'm not looking for that, I want that in my new Zoho Mail inbox appear all my mail messages and conversations as I see it in Gmail. Searching in Google and in Zoho Mail docs the workaround begun
    • Zoho CRM Copilot Connector

      Hello, Are there plans to release a connector for Zoho CRM and Copilot? I'm in the early research stages of potentially switching our CRM solution to Microsoft Dynamics because of its out of the box integration with Copilot. The advantage being that we
    • Drop Down Menu - Adding up values

      I have a form that has 22 drop down fields each having a value of 0-10 to choose from. Is it possible to have it add up the total value of those selected numbers and have it tally it up in another field at the end? So example: if each of the 22 fields
    • [Webinar] Conversational AI: The new paradigm for agentic analytics

      From hard coding to powerful agents, data and analytics is undergoing a tectonic shift, and conversational agents are at the forefront of this transformation. This goes beyond democratizing business intelligence; it's about accelerating the path from
    • Make Rich Text fields available in Canva Print Views

      Everything is on the title. I don't really understand why this is not already possible as Rich Text Fields are available in Canva Detailed Views for example.
    • How to RSVP an invite using the Zoho API

      Perhaps I am missing something, but I don't see any way to use the Zoho API to RSVP an Invite. This what I've tried: PATCH https://calendar.zoho.com/api/v1/calendars/{cal}/events/{event} ?attendeedata={"attendees":[{"email":"me@example.com","status":"ACCEPTED"}],
    • FSM service call view

      "Why can't we sort by assigned service resource in the service call view?"
    • Zia Agents looks promising, but I still cannot deploy my first agent or connect WhatsApp after weeks of support tickets

      Hi Everyone, I am posting here because I am stuck and need practical help from someone who has successfully deployed a Zia Agent with WhatsApp. Zia Agents looks like a very promising product. I have watched the platform expand quickly, and I have noticed
    • Marketing Tip #46: Run flash sales the right way

      A flash sale can do a lot for your store. It can clear slow-moving inventory, spike revenue on a slow day, or reward your most loyal customers. But if done carelessly, flash sales can backfire. Customers start expecting discounts, stop buying at full
    • Send Notify on new Ticket to a Team based on customers email address AND only on these addresses

      Hi ZohoDesk, I would like to have Team A receive a Notification on every ticket created. I would like Team B to receive a Notification email only if the incoming ticket contains elements of a certain group of customer's email addresses only.  They should
    • Inventory API - Retrieve all uploaded product / item images

      I know that I can get the primary image for each product / item or composite item, by using the /image endpoint.  https://inventory.zoho.com/api/v1/compositeitems/<item-id>/image?authtoken=<TOKEN> This will return only one photo, even if the item has multiple images uploaded. Is there a way to retrieve all images stored for an item via the Zoho Inventory API?
    • Change Last Name to not required in Leads

      I would like to upload 500 target companies as leads but I don't yet have contact people for them. Can you enable the option for me to turn this requirement off to need a Second Name? Moderation update (10-Jun-23): As we explore potential solutions for
    • Setting checkbox value on template in Sign from Creator

      Good day, Please help me understand how do I set a tick from a checkbox in Creator into a checkbox on a Sign template. Below is the only values on the Sign template and the code from Creator, "field_boolean_data": {}, "field_date_data": {}, "field_radio_data":
    • 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
    • How to Delete, Disable, or Remove Streams from the Mail App?

      Is there a way to remove Streams from the mail app sidebar? I get too many notifications, it doesn't add any value to Zoho's functionality (especially since you can just make comments inside an email), and is distracting. I do not want notifications/alerts
    • Remove the mandatory Name Card buttons (or at least make them optional)

      Please remove the mandatory Name Card buttons (or at least make them optional) A recent change to the Name Card in Zoho SalesIQ (currently affecting WhatsApp) introduced mandatory buttons before a visitor can provide their name. I believe this change
    • Zoho Wont Login

      Can anyone tell me why my password stops logging in all the time? Is it a ploy to make you change your password? I have to use OTP all the time. I dont want to change passwords all the time. Over the last couple of years I've found myself using Zoho (as
    • Frustrated with Zoho Assist QuickSUpport

      Trialling Zoho Assist and I have a variety of clients. A lot are computer illiterate. Some have poor vision. The current support sessions are using apps which have desktop icons for the appropriate apps. I either connect on demand then the client approves
    • HR Helpdesk Cases

      We have Zoho One Enterprise. I'm trying to find HR Helpdesk Cases, but my UI does not match the documentation. I'm not sure how to move forward.
    • 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
    • Zoho Projects - Will there ever be a send email feature in Zoho Project?

      Hi team, Are there plans to or will there ever be a sendemail feature in Zoho Projects, brining it in line with other similar platforms like Asana, ClickUp and Monday? I know that you can add comments via email to a specific task, but I believe this only
    • Introducing Microsoft Word Integration in Zoho Contracts

      We are excited to announce a new feature that brings contract authoring and negotiation in your familiar environment — the Microsoft Word Integration. What This Integration Brings The Microsoft Word Integration connects Zoho Contracts with the Microsoft
    • Share Video Response Card ion Zobot

      I am using the zobot codeless bot builder in SalesIQ. I want to share a video but delay the next response card until after the video has finished playing or has been stopped. Is this possible?
    • Customer image field

      I created a custom image field for estimates, and it works as expected. The only issue I have is that I want to be able to place the custom image field in the estimate invoice. Is there a way I can do that, the field does not give the option to display
    • Sub Folders

      It would be great if there could be sub-folders in reports. We have a ton of individual reports and folders that would be easier to navigate this way 
    • Goals API - Zoho People

      Hi Team, I would like to get the API details for retrieving organisation-wise Goals from Zoho People. Currently, I am able to retrieve individual employee goals using the following API: https://people.zoho.com/api/v3/performance/goal/{emp_id} However,
    • Question and responses disapear

      I have a form where several people have had issues where the questions, responses or submission simply disappear when trying to complete the form. It seems to be random with no pattern of question, browser or OS. Hopefully there is a fix in the platform
    • Unable to send message;Reason:553 Relaying disallowed. Invalid Domain

      Hi, Now when I try to reply to an email, I see the Unable to send message;Reason:553 Relaying disallowed. Invalid Domain voicemessagedownloader.com error. I tested sending an email when I set it up in the past and it worked. I have checked the Zoho Organization
    • Next Page