Using Zoho CRM SKILL.md to generate complex COQL queries using natural language

Using Zoho CRM SKILL.md to generate complex COQL queries using natural language



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 to solve complex COQL requirements, particularly nested subqueries and JOINs inside subqueries.

Use case 1: Retrieve contacts associated with high-value customers

Requirement

Find contacts associated with Retail accounts that have at least one Closed Won deal worth more than $50,000. Return each contact’s name and email.

Prompt

"
Find all contacts associated with accounts in the Retail industry that have at least one Closed Won deal worth more than $50,000.
For each matching contact, return the contact's full name and email address. Use the appropriate Zoho CRM data-retrieval mechanism and provide the query. Explain how the relationships between Contacts, Accounts, and Deals are handled, including any relevant limitations.
"


Instead of generating a query immediately, the Zoho CRM skill first analyzed the lookup relationships between Contacts, Accounts, and Deals. It identified that Contacts and Deals are both associated with Accounts, but that Contacts do not have a direct lookup relationship to Deals.
Based on this analysis, the skill proposed two methods:
  1. A two-step approach: Retrieve the qualifying Account IDs first, then use those IDs to retrieve the associated Contacts.
    1. Retrieve Account IDs for Closed Won Retail Deals over $50,000
      {
        "select_query": "select Account_Name from Deals where (Account_Name.Industry = 'Retail' and (Stage = 'Closed Won' and Amount > 50000)) limit 0, 200"
      }

    2. Fetch Contacts for those Accounts
      {
       "select_query": "select First_Name, Last_Name, Email from Contacts where Account_Name in ('5843104000002543041','5843104000000425263') limit 0, 200"
      }
  2. A subquery-based approach: 
    Retrieve the Contacts in a single query, subject to the limitations of subquery result handling. The skill also highlighted considerations such as pagination, the maximum number of records supported by a subquery, duplicate Account IDs, and the need to verify field API names against the target CRM organization.
    {

    "select_query": "select First_Name, Last_Name, Email from Contacts where (Account_Name.Industry = 'Retail' and Account_Name in (select Account_Name from Deals where (Stage = 'Closed Won' and Amount > 50000))) limit 0, 200"

    }



           
This illustrates how the skill can assist not only with COQL syntax, but also with relationship analysis, query design, and identifying potential data-volume limitations.

Use case 2: Deals linked to active campaigns and high-revenue accounts

Requirement

Find deals associated with active campaigns and accounts with annual revenue greater than $10 million. Return the deal name, amount, account name, campaign name, and contact email.

Prompt
"
/zoho-crm I need to analyze deals associated with active marketing campaigns and high-revenue accounts. Find deals where the associated campaign has an Active status and the associated account has annual revenue greater than $10 million. For each matching deal, return the deal name, deal amount, account name, campaign name, and contact email. Use the appropriate Zoho CRM data-retrieval mechanism. Explain which relationships are used to retrieve related fields and which conditions require further filtering. Identify any limitations or assumptions in the generated solution.
"



{
  "select_query": "select Deal_Name, Amount, Account_Name.Account_Name, Campaign_Source.Campaign_Name, Contact_Name.Email from Deals where (Campaign_Source.Status = 'Active' and Account_Name.Annual_Revenue > 10000000) limit 0, 200"
}

How the query works

  1. Deals is the base module.
  2. Account_Name.Account_Name retrieves the associated account name.
  3. Campaign_Source.Campaign_Name retrieves the campaign name.
  4. Contact_Name.Email retrieves the email address from the associated contact.
  5. Campaign_Source.Status = 'Active' filters deals based on the campaign's status.
  6. Account_Name.Annual_Revenue > 10000000 filters deals based on the associated account's annual revenue.

Use case 3: Analyze Expected Revenue across deal stages

Requirement

A sales manager wants to understand the total Expected Revenue generated at each deal stage. The analysis should include the Stage and the corresponding total Expected Revenue.

Prompt

"
A sales manager wants to understand the total Expected Revenue at each Stage. Find all deals, analyze them based on their stage, and calculate the total Expected Revenue for each stage. Return the Stage and total Expected Revenue, and explain how the generated solution works, including any limitations or assumptions.
"



{
  "select_query": "select Stage, SUM(Expected_Revenue) as Total_Expected_Revenue from Deals where (Stage is not null) group by Stage order by Stage asc limit 0, 200"
}



Validation is as important as generation

  1. A syntactically valid query may still fail to meet the business requirement. Always verify:
  2. The correct fields and lookup relationships are used.
  3. Subqueries do not exceed record limits.
  4. Owner and picklist values are valid.
  5. Pagination and duplicate records are handled.
  6. The query returns the intended records, not merely related records.

Conclusion

By using the Zoho CRM `SKILL.md` with GitHub Copilot, developers can explore how an AI coding agent handles these requirements, from identifying the relevant modules to constructing and validating the query.
The most valuable outcome is not simply a generated COQL statement. It is understanding how the SKILL.md translates a business requirement into a technically valid and appropriately scoped CRM data-retrieval solution.
Try the examples with GitHub Copilot, compare the generated solutions with the documented COQL patterns, and examine how the SKILL.md  handles limitations and ambiguities.
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 #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

    • Ability to translate Zoho CRM Kiosks

      Hi team, Is support for translating kiosk text and screen names in the Zoho CRM translation tool planned on the roadmap? Thanks,
    • Files in Teamspaces: keep your team's documents where the work happens

      Release Note: This feature is available for all accounts across all DCs Hello Everyone, A Teamspace is built around a specific team and a shared objective, and it holds the modules and projects that team works with every day. The document that team depends
    • How to download multiple files in Creator?

      I'm trying to download multiple files from a creator report using a for loop but it only seems to be downloading one file. It seems like no more code can be run after downloading this one file. Is there a way to download multiple files? I'm currently
    • 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.
    • ZohoMail_get_mail_attachment corrupts binary attachments (PDFs) over MCP

      Hi all, The Zoho Mail MCP tool ZohoMail_get_mail_attachment returns binary attachments as UTF-8 text, so PDFs come back corrupted and an AI client can't read or save them. What we see: - The response header is content-type: application/octet-stream;charset=UTF-8.
    • Request: Custom CSS Theme

      I would really like a custom CSS theme that enables me to completely customize the look and feel of the survey page based on the typography of my company brand. Unfortunately, there does not appear to be complete customization with existing themes. This
    • 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
    • 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
    • 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
    • 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

      Update (November 16, 2026): This incident is resolved. In its final update on November 14, Microsoft confirmed that all affected services have fully recovered and the backlog of email messages has been processed. Microsoft lists the end of impact as November
    • 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
    • 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
    • Next Page