Kaizen 264 - Using zoho-crm Skill to Write Functions

Kaizen 264 - Using zoho-crm Skill to Write Functions



Hello CRM wizards,

Welcome back to another week of Kaizen.

In our previous Kaizens, we explored how the zoho-crm skill can assist you across various Zoho CRM developer tools. This time, let us see how it can help you write Deluge Functions, from simple workflow automations to complex integrations with third-party services. 

Since Deluge is a Zoho's exclusive scripting language, let's put the skill to test with three use cases of increasing complexity. We'll start with a basic field update, move on to querying CRM data, and finally explore an integration with Zoho Books. 

If you are starting new with the skill, check out Kaizen #258 on Getting Started with zoho-crm skill for more information.

Case 1: Automating a Simple Field Update

Let's start with a straightforward use case. 

Prompt 

Quote/zoho-crm Whenver the Phone field of a lead is populated or updated, automatically copy its value to the Mobile field.

Response



The skill identifies the appropriate approach which is a function triggered by a workflow rule. It generates Deluge code and provides the steps needed to put the solution into action. This includes instructions for creating the workflow rule, configuring its trigger and mapping the function arguments to the relevant fields. 

As a result, you get more than just a code snippet. The skill also guides you through the CRM configuration needed to make the function work. 

Info
Watch all the videos till the end to see the generated code in action.

Case 2: Identifying and Updating Stale Leads Using COQL

Now that we have covered a basic automation, let's introduce a little more complexity. This time, we'll use COQL to query CRM records and update them based on specific conditions. 

Prompt

Quote/zoho-crm Identify stale leads in Zoho CRM that have had no meaningful activity for more than 30 days and update their custom Lead Health field to “Stale”.

Response



Notice how the skill asks for additional information when the initial prompt doesn't provide enough details to implement the solution. Once the requirements are clarified, it generates the function code to indentify stale leads and update their Lead Health field.

It also guides you through the setup required to run the function, including creating a connection with the appropriate OAuth scopes and configuring a schedule. Before running the function, it recommends verifying that the field names and other details in the generated code match your CRM setup. 

There's another useful detail to look out for, which is the error handling. The generated code includes a failure-handling path that sends an email to the logged-in user if it cannot update a lead's health status. This helps notify the user when something goes wrong, making troubleshooting easier. 

You can also explicitly mention error handling in your prompts, and the skill can incorporate it into the generated code.

Notes
The skill generated codes are available on our github for your reference. 

Case 3: Creating Zoho Books Invoices from Zoho CRM

Let us take things up a notch and explore a use case involving third-party APIs. 

Prompt

Quote
/zoho-crm Need to create an invoice in Zoho Books when a Deal in Zoho CRM is closed with a stage Closed Won and save the invoice ID from the API response in the Deal's Invoice custom field.

1. Fetch the Deal's Stage, Account ID
2. Make a Related Records call and find the associated Quotes ID
3. Fetch the line items from the Quotes
4. Using the account ID find the Zoho Books customer ID
5. Create an invoice with the customer ID and line items
6. Update the invoice ID in the deal's Invoice field

connection link name : books_oauth_connection
Books Org ID: 131786026

Response



In this scenario, the function integrates Zoho CRM with Zoho Books to automate invoice creation for closed-won deals. The workflow involves retrieving the relevant CRM details, identifying the corresponding customer in Zoho Books, and using the required information to create an invoice. 

Unlike the previous examples, much of the function's logic depends on the responses returned by earlier API calls. The function must process those responses extract the necessary details and pass them to subsequent API requests. 

For complex use cases, the more context you provide, the better the skill can tailor the solution to your requirements. Describing the expected code flow, the sequence of API calls and the data to be passed between them can help reduce the need for multiple iterations. 

You can also refer the skill to relevant third-party API documentation help pages when you need it to follow specific API requirements. 

Notes
Note

The key is to start with a clear requirement, provide additional context when needed, and review and test the generated code before deploying it. The skill can help with both the implementation and the steps required to configure the function in Zoho CRM. 
We hope you find this kaizen helpful.

Have questions or suggestions? Drop them in the comments or write to us at support@zohocrm.com.

On to Better Building!

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
Idea
Previous Kaizen: Using Zoho CRM Skill to Build Widgets | Kaizen Collection: Home
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------

    • 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 #261 : Using Zoho CRM Skill to generate complex COQL queries

      Hello everyone, In the previous Kaizen posts, we introduced the zoho-crm SKILL.md and discussed how it can help you when you are working with Zoho CRM APIs and Client Script. In this Kaizen, we will focus on using the Zoho CRM `SKILL.md` with GitHub Copilot
    • 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
    • Recent Topics

    • Rebrand your CRM with the all-new custom domain mapping setup

      UPDATES TO THIS FEATURE! 19th Jan, 2024 — Custom domain mapping has been made available for portal users in Zoho One and CRM Plus. 23rd June, 2023 — Custom domain mapping has been made available for all users, in all DCs. Hello everyone! We are elated
    • Découvrez le nouveau Zoho Analytics : l’analytique agentique pour toutes les entreprises

      Nous sommes ravis de vous annoncer le lancement du tout nouveau Zoho Analytics ! Cette nouvelle version marque un tournant majeur dans l’évolution de la plateforme. Initialement conçue comme une solution de BI en libre-service permettant de créer des
    • Zia Agents in Zoho CRM: a better way to set up digital employees

      Hello everyone, If you've been using Zia Agents in Zoho CRM, so far using Connections was the only deployment method you're familiar with. You create an agent in Zia Agents (define its objective, write instructions, use tools, add knowledge base) and
    • Keeping phone number text format exporting from Books to Sheet

      We have a custom function that copies data from our customers in Books to Sheets. In the process the customers' phone numbers (unless they contain a space) get treated as numeric values, so leading zeros get stripped off, and in some cases scientific
    • Duplicate Record Creation

      Hello Team, I would like to check whether there are any options available in Zoho FSM to prevent duplicate record creation in the following modules: Assets Companies Contacts Ideally, we would like the system to check for existing records before allowing
    • Admin Logging in as another User

      How can a Super Admin login as another user. For example, I have a sales rep that is having issues with their Accounts and I want to view their Zoho Account with out having to do a GTM and sharing screens. Latest Update (27th April 2026): With the early
    • KB Articles - Can't See Content or Trigger Immediate Sync

      Once a file has been submitted to the KB, there's no way to check what it actually contains. There's also no way to force an immediate sync with the source document. These are issues when one is developing and testing an agent. It makes troubleshooting
    • Tool Parameter UI - Freeze Header

      When one has a number of tools with a number of parameters, scrolling down hides the heading information, forcing one to scroll back up to get confirmation which radio button is which: Seems like simply freezing the header would eliminate that issue.
    • Cannot replace custom tools

      This is so incredibly frustrating. Create a tool group. Add your custom schema to create your custom tools. Attach to an Agent. Now you need to update your schema to make an adjustment? You can't edit the schema or even re-upload a new schema. It blocks
    • Testing Tools - Can't View Response

      When adding a custom tool and trying to test it, one can see whether or not the test has a successful http response, but the actual payload cannot be viewed to verify the tool's performance. I thought that's what the little hover link was for, but mousing
    • more native app support for linux

      Dear zoho,pls build additional apps like zoho valt,zoho sheets,zoho show,zoho authenticator apps for linux ,because more and more people are increasing switching to linux this days,
    • Unbundle feature for composite items

      We receive composite items from our vendors and sell them either individually or create other composite items out of them. So, there is a lot of bundling and unbundling involved with our composite items. Previously, this feature was supported in form
    • Quick Reference Guide on join.zoho.com

      Joining a remote session can be difficult for the people who need it the most. Please add a quick reference guide and better documentation that my Grandma can read on the join.zoho.com site. It's not uncommon to spend 10minutes or longer in a session
    • Zoho Projects - Auto Populate Project on Project Invoices

      Hi Projects team, I noticed that when creating an invoice from a Project in Zoho Projects, the project is not selected on the invoice. Is this something which you would consider as a feature request? It seems silly that when you create an invoice from
    • Times prepopulating in Date/Time field on deal records

      Support tells me that there is no workaround to having the time auto-fill on a date/time field in our deal records -- that is HUGELY inconvenient and creates massive opportunity for error. Our deals involve several parts over various days/times, none
    • Email-Data Synchronization with Zoho Analytics

      Hello, Enterprise Support Community! We're excited to announce the availability of Email Data Synchronization with Zoho Analytics! This highly requested enhancement allows you to sync email data from Zoho CRM into Zoho Analytics, making it easier to analyze
    • Multi-Day Installations

      We schedule technicians on multi-day installations. A single appointment from Monday 8 AM through Friday 5 PM counts as 105 working hours, causing false overbooking. We need one appointment spanning five days but only 40 hours counted toward technician
    • Making shared forms available offline

      Hi, We used to be able to have our forms available offline even if it was a shared form. now we can't. Is this a new bug?
    • Zoho Forms API

      Is there any way to get all form entry list using API? Looking forward to hear from you
    • Documents greater than 40MB Preview

      hello, Documents bigger than 40 MB cannot be previewed in WorkDrive Web App or Mobile App. would it be resolved in future?
    • Calendar Booking - Related Deal

      Is it possible to automatically associate a Calendar Booking with an existing Deal in Zoho CRM? We're trying to use the native Calendar Booking feature. Our goal is to send a booking link to a customer from an existing Deal record, so that when the customer
    • Approval Process configuration is now more flexible and fully customizable

      Hello everyone! Approval Process is back with a better user experience that makes it easier to add rules to your processes. This enhancement includes some UI updates that help you create highly structured approval stages—and more. Let's look at the enhancements
    • Kaizen #268: Using Zoho MCP to Build and Configure Zoho CRM Cadences

      Hi everyone! Welcome back to the Kaizen series! In the previous Kaizen posts, Kaizen #265 and Kaizen #266, we explored how Zoho MCP can be used to work with Zoho CRM records, retrieve metadata, customize CRM, configure automation, and even coordinate
    • Deliverability Update: Impact of the Ongoing Microsoft 365 Service Disruption on Email Delivery

      Zoho Campaigns is operating normally. Microsoft is still recovering from a global incident that affects multiple Microsoft 365 services, including Exchange Online and Outlook. If your mailing lists include Microsoft-hosted addresses (@outlook.com, @hotmail.com,
    • Trigger a Workflow Function if an Attachment (Related List) has been added

      Hello, I have a Case Module with a related list which is Attachment. I want to trigger a workflow if I added an attachment. I've seen some topics about this in zoho community that was posted few months ago and based on the answers, there is no trigger
    • Zoho Inventory - Imporoved Order Fulfillment Reporting

      Hi Inventory Team, i've tried to contact you through support@eu.zohoinventory.com but haven't received a response. I am contacting you on behalf of a client. Our client is a car parts wholesale business and we set them up on Zoho Inventory earlier this
    • Say Hello to Telephony in Zoho FSM

      Zoho FSM now brings complete telephony support so your team can manage inbound and outbound calls without switching tabs. Faster responses, smarter routing, and total call visibility—all in one place. Choose the telephony setup that works for you Zoho’s
    • Increasing API Credits

      Hello everyone! Organizations consume Zoho CRM APIs for various business needs, and it's a show-stopper when you exhaust your API credits before the 24-hour rolling window replenishes your credits. To meet your growing needs and help you keep your business
    • [Online Training] Zoho RPA masterclass: Fundamentals, SAP® automation, & AI workflows

      Hello everyone! Greetings from the Zoho RPA Training Team! We're excited to announce our upcoming Online Training on Zoho RPA. Manual, repetitive tasks like entering data, updating spreadsheets, managing files, and extracting information from documents
    • Zoho Inventory | Can't uncheck/turn off Advance Tracking

      Hi, I wanted to know if there's a way to turn off Advanced Tracking (such as Serial Number or Batch Tracking) for an item in Zoho Inventory. I’ve read that you might need to delete associated transactions and clear the opening stock to disable these features.
    • 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
    • Join Zoho Meeting only via Web browser and not with Zoho Meeting App

      Dear Zoho team, according to the documentation [1], Zoho Meeting only offers web view for Chrome and Firefox on a desktop. For other browsers and devices, participants can only join a Zoho Meaning with the Zoho Meeting App installed. This is a big hurdle
    • Getting an error when trying to use the Zoho Desk Resources with our Zobot chat

      Hello, When I try to set our Zobot AI Card Training to Zoho Desk resources I get an error when testing it and it bypasses the bot completely. When I try to switch it to the Zoho SalesIQ resources option in there it will list some articles but not give
    • KB Articles from Zoho Learn - Import as .md

      I love the concept of being able to use articles from Zoho Learn as knowledge base articles for Zia Agents. This will absolutely help with proper documentation and organization of company processes and SOPs. This was a great concept. However, even when
    • Request for Zoho Desk Version and Module Details

      Kindly help us confirm the version of Zoho Desk currently being used in our portal, along with the module/edition name. We require this information urgently for our internal documentation.
    • Cannot reorder fields in Page Layout in Expenses and Purchase Requests

      It is very inconvenient that the custom fields in Page Layout cannot be re-ordered. The only way is to remove the fields and re-create them; however, it is impractical. This would affect the reports and dashboards we are having. Not able to re-order the
    • Purchase Requisition in Zoho Books

      I want to understand if Zoho Books is having the following workflow: PR ( Purchase Requisition ) >> PO ( Purchase order) >>  GRN/SRN ( Goods/Services receipt note) >> Bill
    • Tips & Tricks #8 | Zoho Mail: Seguridad, privacidad y control para tu empresa

      El correo electrónico sigue siendo una herramienta fundamental para cualquier organización. Por él circulan comunicaciones internas, información de clientes, documentos confidenciales y datos esenciales para el negocio. Por eso, elegir un proveedor de
    • Personalize Email Campaigns using CRM Data

      Recently, few of our CRM users wanted to send an email campaign with personalized sender details and signature so that recipients can instantly recognize the sender. We are happy to announce the new enhancement in campaign creation through which you can personalize your email campaign using CRM Contact/Lead Owner's data. Let’s see how we can use those data to send emails.   Personalize sender details Using Zoho Campaigns, you can send an email campaign with a personalized sender name and email address
    • 集めて終わりにしない。― Zoho FormsからCRMへデータをつなぐ

      ユーザーの皆さま、こんにちは。ゾーホージャパンの友田です。 Zoho Formsで問い合わせや資料請求を受け付けた後、その情報をどうしていますか? 例えば、 フォームから届いた氏名や会社名、メールアドレスを確認して、Zoho CRMにも同じ情報を入力している。 そんな作業が発生している場合、FormsとCRMをつなぐことで、その手間を減らせるかもしれません。 Formsに入力された情報をCRMへ Zoho Formsは、Zoho CRMと連携できます。 例えば、Webサイトから資料請求を受け付ける場合、
    • Next Page