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

    • Announcing the new SKILL.md for Zoho CRM and the updated OAS repository!

      We are introducing a new zoho-crm skill to make working with Zoho CRM Developer tools (like APIs, functions, widgets, client scripts, queries etc) easier and faster, with the help of AI in your preferred AI harness like Claude Code, Codex, Cursor, VSCode
    • Kaizen #256 - Build an Arrival Readiness Web Tab in Zoho CRM

      Hi everyone! Welcome back to the Kaizen series! In the post, we discuss a use case in hospitality industry: how an Arrival Readiness web tab widget can be used to let reception staff identify and resolve issues before arrival of guests. Use case In the
    • 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
    • Recent Topics

    • 📣 Ask the team behind Zoho SalesIQ: Summer '26 Q&A

      Hi everyone! Following our recent webinars, Summer '26 Release: What's New in Zoho SalesIQ—where we walked you through all the new features, what they do, and how they work—and Driving the AI Evolution: Building Smarter Customer Experiences with Zoho
    • Upcoming update to field values in Zoho Books - Zoho Analytics integration

      Hello Users, We'd like to inform you of an upcoming update to the tax_category values in the Zoho Books integration for Zoho Analytics from October 20, 2026. What's Changing? tax_category field values are being renamed to align with the conventions already
    • Announcing the new SKILL.md for Zoho CRM and the updated OAS repository!

      We are introducing a new zoho-crm skill to make working with Zoho CRM Developer tools (like APIs, functions, widgets, client scripts, queries etc) easier and faster, with the help of AI in your preferred AI harness like Claude Code, Codex, Cursor, VSCode
    • Kaizen #259 - Working with Zoho CRM APIs using zoho-crm skill

      In the previous Kaizen, we introduced the zoho-crm skill and discussed how it can work with different CRM developer capabilities. The zoho-crm skill makes it easier to work with Zoho CRM without having to remember every API endpoint, request structure,
    • How can I populate dropdown data with information from another source or app?

      I want to maintain a list of items in another app (say in excel or another database) and sync those as items in a drop down menu, instead of copy pasting to import. Is this kind of a feature available?
    • Zoho Community Digest - September 2026 | Part 1

      Hi everyone, and welcome back! September opens with a strong set of updates. Zoho CRM brings workflow automation down to the subform row level and ships a new SKILL.md for AI-assisted development, Zoho Desk introduces conditional branching with Automation
    • Tip #88 – Manage Incoming Support Requests Efficiently with the Service Queue – 'Insider Insights'

      Hello Zoho Assist Community! Not every team has a dedicated IT department or a fully built-out sysadmin setup. For smaller teams, when something breaks, there's no internal ticket system to log into, no helpdesk queue to route through, and no clear way
    • Delete CRM Portal

      How do I delete portals from my CRM? I created one just to test, it is not in use and is disabled but it's existence is preventing me from marking fields in modules as "required" unless I make it 'read/write' in the portal first. I'd rather just delete
    • Zoho Books | Product updates | July 2026

      Hello users, We’re excited to bring you the latest updates in Zoho Books for July 2026! This month's release introduces Terminal Payments, CMP-08 filing for composition taxpayers, SEPA Credit Transfer support, and Self-Billed Credit Notes and Debit Notes
    • Calendar invites from Contacts not being assigned to Account in CRM

      Hi all It's that time of year again when I try to get calendar and meetings sorted in CRM. I have two way sync enabled. I have the option set to check for customer meeting invitation mail and to add them as meetings. However, whilst those meetings show
    • Kaizen #258 - Getting Started with zoho-crm SKILL.md

      Howdy tech wizards, Welcome to a fresh week of Kaizen. This week, we are taking a look at the zoho-crm SKILL.md, an Agent Skill designed to help AI coding agents work with Zoho CRM’s developer capabilities. What is zoho-crm SKILL.md? The zoho-crm skill
    • Zoho Tables is now live in Australia & New Zealand!

      Hey everyone! We’ve got some great news to share — Zoho Tables is now officially available in the Australian Data Center serving users across Australia and New Zealand regions! Yes, it took us a bit longer to get here, but this version of Zoho Tables
    • Dashboard/Component filter by probability

      Hi all Can I request the ability to add a Component or Dashboard filter for Deal Probability? Would be useful to be able to see data of deals more than 60% probable. Olly
    • Stock (on-hand) Items not updated after using Composite items

      Hi there, I created a Composite item (consist of 3 items). After I created the Composite item, I invoiced it and shipped the items. However the actual stock on hand of the 3items didn't change at all. Have you guys encountered this? Thank you Regards,
    • Is there a way to show contact emails in the Account?

      I know I can see the emails I have sent and received on a Contact detail view, but I want to be able to see all the emails that have been sent and received between all an Accounts Contacts on the Account Detail view. That way when I see the Account detail
    • Important changes for users with Zoho accounts in the UAE and other Data Centers

      What's changing? Previously, the same email address could be used to create separate Zoho accounts in both the UAE data center and another Zoho data center (such as US, EU, IN, AU, JP, CA, SA or SG). With this change, an email address can be associated
    • Conditional Layouts On Multi Select Field

      How we can use Conditional Layouts On Multi Select Field field? Please help. Moderation update: Multi-select picklist fields are now supported in Layout Rules. Additionally, Layout Rules is now available in the Professional Edition. These updates have
    • Zoho Marketing Automation WhatsApp Campaign Import Sync for Zoho Analytics

      WhatsApp is a critical channel in modern marketing, yet WhatsApp Campaign metrics from Zoho Marketing Automation currently cannot be natively imported into Zoho Analytics via the default advanced analytics connector. Integrating this into the standard
    • merge the Multiple POs to single PO if Vendor of PO"s --in Zoho Inventory

      HI Merge the Multiple POs to single PO if Vendor of PO"s are Same ----in Zoho inventory Please provide any work around to achive this .
    • Delug script

      I have been looking at auto-update a amount (home currency) field from another module. Zoho native multicurrency was used in the other module (we have 4 here). Custom script was input with no error, but the field was not updated on trigger. Script as
    • Is there a CRM Deluge function available to convert an RTF (rich text field) to plain text (with no formatting tags)?

      I know that we can run reports so that RTF fields can either show as plain text or the text or the text with the formatting fields included (which is wonderful, btw, as it helps me adjust tags when I need to troubleshoot and just see what I need to see
    • 【Zoholics Japan 2026】ITreview 口コミ投稿キャンペーンを実施します!

      ユーザーの皆さま、こんにちは! 2026年9月25日(金)開催の「Zoholics Japan 2026」会場にて、 Zoho CRM・Zoho Workplace・Zoho Mail を対象とした「ITreview 口コミ投稿キャンペーン」を実施します! Zoholics にご来場いただく皆さま、ぜひこの機会に普段お使いの Zoho 製品について、率直なご感想をお聞かせください。 【キャンペーン内容】 対象製品: ・Zoho CRM ・Zoho Workplace ・Zoho Mail キャンペーン実施時間:
    • Contact removed when picking ticket template.

      hi new to Desk rolling out to company, replacing Freshdesk. Is there way to keep the in context contact when selecting a template? When you choose a template you lose the contact!
    • Using IMAP configuration for shared email inboxes

      Our customer service team utilizes shared email boxes to allow multiple people to view and handle incoming customer requests. For example, the customer sends an email to info@xxxx.com and multiple people can view it and handle the request. How can I configure
    • Global Sets for Multi-Select pick lists

      When is this feature coming to Zoho CRM? It would be very useful now we have got used to having it for the normal pick lists.
    • Bank Transaction Rules Link Under Each Bank Account

      Hello, can you'll move the "transaction rules" button or link back under each bank account? It is now on Bank Overview, if I am working on a specific bank account, I don't want to go out to overview to check the rules. That button displays rules for all
    • Nested notebooks

      Dear Sir/Madam, I would like to know if it is possible to nest notebooks. It would be very helpful when there are too many, as it would improve organization. Thank you for your response. Best regards.
    • 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
    • Zoho CRM

      Cuándo voy a adjuntar un archivo .pdf en un registro en el campo Archivo obtengo el siguiente error:
    • Implement Meeting Polls in Zoho Bookings

      Dear Zoho Bookings Support Team, We'd like to propose a feature enhancement related to appointment scheduling within Zoho Bookings. Current Functionality: Zoho Bookings excels at streamlining individual appointment scheduling. Users can set availability
    • Recording Salaries and wages in zoho books with bank fees

      Hello Community, I am posting this questions to understand the best way to record the salary and payroll expenses in zoho books. The way it works here, For example if I have 3 employees and each employee salary is lets say $1000. I usually use the bank
    • API - Available Stock Definitions

      Okay, Zoho team... your copywriters fell down on the job for this one :) I think these warrant a bit more explanation as to what they include and what they don't.
    • [BUG] WebTabs in ZohoCRM now have a spurious "\" displayed along with some additional HTML Head code included

      An example of the issue can be seen below:
    • CNIL - Suivi de Pixel

      Bonjour à tous, À la suite de la nouvelle recommandation de la CNIL sur les pixels de suivi dans les e-mails, savez-vous si Zoho Campaigns permet : de conditionner le suivi des ouvertures au consentement de chaque contact ; de proposer un lien permettant
    • Scheduled import

      The tutorial shows a scheduled import option but this option doesn't appear to be available when using Zoho DB.
    • #4 Choosing How My Invoice Should Look

      Day 4: Meera had the basics sorted. Her business name was there, the address looked right, and her logo finally appeared where it should. But the invoice still did not quite look like hers. Her old studio used invoices that were clean, tightly laid out,
    • Transaction rules for "Owner's Contribution" ?

      I have a bank account where a lot of the deposits are "Owner's Contributions" (i.e., the business owner investing money in the company). Is it possible to create a Transaction Rule to automatically recognize these? They all have the same verbiage from
    • DYK 12: Turn Email into Work Items

      Did you know you can add work items to your Zoho Projects portal directly from your inbox? The initial step of important collaborations start over an email, and most of these require an immediate follow-up by creating a task, or reporting an issue. During
    • Custom Function not getting package details when triggered from Workflow Rules.

      I have a custom function for Packages that submits a form in our Creator app that we use to generate custom shipping labels (internal staff complete deliveries so we cannot generate shipping labels straight from Inventory). When the function is executed
    • how to Solve Conflict Invoices in Zoho POS

      Hello Team, I am facing a repeated issue in Zoho POS while saving a sale that contains service-based items. My products are intentionally created as Service (Non-Inventory) items because I do not want to track stock for them. However, every time I try
    • Next Page