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

    • Any Possible to change the challan type in Delivery challan ?

      Hello Team, We need to add the more values in challan type in delivery challan module in Zoho Books.So how to add additional values in challan type field. Please find following snap for your reference. Thanks in Advance, Thisai Moorthy.
    • Zoho ERP | Product updates | July 2026

      Hello users, We're back with another round of updates to help you streamline your operations. This month's release brings new features and enhancements designed to help you work more efficiently. Read on to discover everything that's new in Zoho ERP this
    • Show when an invoice has been viewed

      It would be nice to know if/when a customer has viewed an invoice. This would mean not having PDF attachments and just have the link to the invoice. My previous invoicing solution had this feature and I did not realize how much I used it until it was gone. Would this be possible, or this already available and I am just missing it?
    • 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
    • Zoho Books | Product updates | March 2026

      Hello users, We’ve rolled out new features and enhancements in Zoho Books. From Advanced Reporting Tags to the ability to mark projects as completed, explore the latest updates designed to improve your bookkeeping experience. Introducing Advanced Reporting
    • Separator line

      Is there a way i can insert a line in an invoice or quote without showing qty or prices? e.g. Options I Item description qty and price Option II Item description qty and price Thanks
    • All new Address Field in Zoho CRM: maintain structured and accurate address inputs

      Availability Update: 29 September 2025: It's currently available for all new sign-ups and for existing Zoho CRM orgs which are in the Professional edition exclusively for IN DC users. 2 March 2026: Available to users in all DCs except US and EU DC. 24
    • BCC Drop Box Centralisation

      Hi Team, For the last few years, I have had a question related to the Zoho CRM BCC Dropbox feature. Although BCC Dropbox is very useful for tracking customer email communication, I have always wondered why its configuration is managed at the individual
    • Kiosk Page Refresh

      We have a Kiosk running from a button in contacts to update values and also add related lists, which works great, but when the kiosk is finished the page does not refresh to show the changes. Is there a way to force the contact to refresh/update when
    • CRM Integration - Option to Sync Reporting Tags

      It would be nice to be able to sync reporting tags in Zoho Finance to a custom field in Zoho CRM. My use case is for a Customer in Finance to an Account in CRM (and vice-versa, of course), but I'm sure it's pretty obvious that this could also be used
    • Zoho Books | Product updates | August 2026

      Hello users, July has been an exciting month for Zoho Books! This month, we're excited to introduce HTML PDF Templates, Placeholders as Pills, expanded approval workflows for Sales Returns and Journals, and significant compliance updates across the India,
    • Join the Zoho Desk Virtual Classroom Training (VCRT)

      Hello everyone, Have you heard about Zoho's Virtual Classroom Training (VCRT)? Zoho Desk's Virtual Classroom Training offers end-to-end training for Zoho Desk users. Join the VCRT and get hands-on guidance for setting up Zoho Desk and getting your business
    • 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.
    • Zoho CRM Approval Process based on Field Update

      Hello, In current structure, Zoho CRM send records to approval based on record creation and edit.  I think, it should be to set approval process trigger based on any field update in record. When the user update any field, the record can assign to approval
    • Where do I edit the "Welcome to [portal name]" message

      I am looking for a way to edit the "Welcome to" part of the message that is seen on the landing page (ex: https://help.zoho.com/portal/en/home). When I use the French interface, it doesn't make sense... I want to change it from "Bienvenue chez" to" Bienvenue au". Thanks!
    • Approve records efficiently: Useful enhancements to My Jobs module and Approval process in Zoho CRM

      Dear Customers, As you might know, approval process is a process automation tool that allows you to automate approvals in your organization and My Jobs is where you approve requests from a single point of view. Here's how you'd go about it: You’d add
    • Zoho Assist may be a struggle for repeatted clients

      I am supporting people via AnyDesk and sometimes via Acronis CyberProtect Connect. The latter is EoL this year. Some clients are computer illiterate or have poor vision and even getting them to go to a website is a struggle and to download something and
    • 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.
    • Introducing the Store Locator widget

      Hello everyone! Your website is often the first place customers visit before deciding where to shop. But when they can't quickly find the nearest store, check business hours, or get directions, many leave your website and search elsewhere. Every extra
    • Important updates to your connectors

      Hello everyone, Greeting from Zoho Creator! We're excited to announce that we'll be rolling out significant backend updates to Zoho Creator's built-in connectors to enhance security by following the latest frameworks. The existing version of some of the
    • Important updates to your Salesforce integrations in Zoho Creator

      Hello everyone, We're writing to inform you of an important change regarding Salesforce integrations in Zoho Creator. Salesforce has introduced new security requirements for third-party platforms that connect with their services via APIs. To comply with
    • Password Policy in Zoho Mail: Set password rules to keep your organization secure

      Weak or repetitive passwords are one of the most common causes of unauthorized account access in organizations. Zoho Mail's Password Policy feature allows administrators to define and enforce specific password requirements for all users in the organization,
    • What is Workqueue and how to hide it?

      Hi, My CRM suddenly have this "Workqueue", may I ask how to set the permission of this tab?
    • Zoho Community Digest - July 2026| Part 4

      Hi everyone, and welcome back! We're closing out July with a strong final week, from a major LinkedIn integration in Zoho Recruit to AI-powered forecasting in Zoho Analytics. There are also a few heads-ups worth noting, including API changes in Zoho CRM
    • Zoho CRM Community Digest - July 2026| Part 2

      Hello everyone! The second half of July brought five CRM updates, including a heads-up for developers on API changes coming in October, one Quick Win on keeping your attribution data intact through lead conversion, two Dev's Corner threads worth bookmarking,
    • Shared Snippets Everyone

      Hi, Now that the Shared Snippets have been released and I think will be the most used feature implemented in 2023 :) Creating and Using Snippets in Ticket Responses - Online Help | Zoho Desk Maintain consistency in ticket responses with shared snippets
    • Keeping project teams in the know with Zoho Cliq

      Project management is all about processes, data flow, and maintaining order. But communicating appropriate information at crucial times to stakeholders is as important as the moving parts of a project. Zoho Cliq can facilitate effective communication
    • Remove "Subject" as a required field on quotations

      Not sure why, but Zoho has made 'Subject' a system defined required field. I'm not entirely sure why subject would be required as a key field (i.e. you cannot deactivate it or change it from required). It doesn't make much sense on many product quotations,
    • Multi-currency and Products

      One of the main reasons I have gone down the Zoho route is because I need multi-currency support. However, I find that products can only be priced in the home currency, We sell to the US and UK. However, we maintain different price lists for each. There
    • Enable Credit Note creation for Sales Returns BEFORE receiving goods

      Currently, it is not possible to issue a Credit Note linked to a Sales Return until the goods have been officially marked as "received" in the system. In our business, we often need to issue a credit note to our clients immediately upon the initiation
    • Best way to setup Inventory bin tracking for products with multiple boxes/crates

      Hi - we need some advice from the community on setting up Items in the Inventory for products with multiple crates. We have large products in our warehouse where the product is delivered as two large (double pallet) crates. We've setup the Items for these
    • Getting Internal Server Error message when filing for MTD

      I am trying to file for the MTD submission, and after I filled in all the information and click (Fetch Obligation) this message "Internal Server Error [500]" pops up. I have been trying for awhile and its still the same. What shall I do as today is deadline
    • No access to change view permission for team members

      Hi, I want team members to be able to update the percentage progress on their goals at mid year. Currently they cannot edit this, they can only update the comments against the goals. The ability to add view permission to goal progress for team members
    • Turn your Zoho One Home into your workspace with Dashboard 2.0

      When you open Zoho One, you probably don't need to see everything. You need to see what matters to you. A sales manager may want to track pipeline and revenue. An HR manager may want to monitor employee information. A business leader may want a quick
    • Zoho Assist Feature Update: August 2026

      Web Forms Web Forms in Zoho Assist help you collect support requests directly from your website and route them to the right team. Embed a customizable form so customers can raise issue details or join an active remote session using a session ID. Depending
    • Tip #84 – A More Natural Remote Experience with Custom Cursor Support – 'Insider Insights'

      Hello Zoho Assist Community! Anyone who has spent time in a remote support session knows the feeling. You're guiding a customer through a task, moving the cursor across the screen, and something feels just slightly off. The cursor doesn't behave the way
    • 【無料/オンライン】8/20開催|Zoho ワークアウト|ユーザー同士で学び合うオンラインもくもく会

      ユーザーの皆さま、こんにちは。 コミュニティグループの中野です。 8月20日(木)開催の「Zoho ワークアウト」をご案内します。 Zoho ワークアウトは、参加者それぞれが取り組みたいテーマを持ち寄り、 ユーザー同士で交流しながら、設定・検証・運用改善を進めるオンラインの「もくもく会」です。 「作業を進めたいけれど、一人だと手が止まってしまう」 「他社がどのように活用しているのか知りたい」 「同じ課題を持つユーザーと情報交換したい」 そんな方は、ぜひお気軽にご参加ください。 ▶︎ 参加登録はこちら(無料)
    • Assign Price Book to Accounts (again!)

      I can see this topic has been bumping about for over 10 years and unfortunately Zoho hasn't seen the need (or use case) in CRM to be able to assign an account to a price book to automate quoting (amongst other things). Strange given they DO assign price
    • Custom Statuses - Can You Do Anything With Them?

      As far as I can tell, one really cannot do much with custom statuses. I created a new custom status for sales orders called "Customizing / Hold". This is for sales orders that have the Confirmed status. The use case here is that, as an e-commerce company,
    • Price Book in foreign currency

      We have many customers who buy in foreign currency (USD), where our base currency is our local currency (AUD). It would be normal (it is in Zoho Books, Zoho Inventory etc.) to assign a currency to a price book, but I cannot find this option in Zoho CRM
    • Next Page