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

    Nederlandse Hulpbronnen


      • Recent Topics

      • 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,
      • 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
      • 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サイトから資料請求を受け付ける場合、
      • Sheet co-edit: no live presence — also on Collaborate demo?

        Two Sheet co-edit sessions open OK (same document_id, document.edit: true), but there’s no real-time collaboration: no cell highlights, Group Chat → Users stays empty. Writer co-edit works on the same Office Integrator setup. We see the same on the official
      • Short product videos on Zoho Commerce product pages: what works?

        Short product videos are becoming a normal part of online store pages, and I have been thinking about how to use them well on a Zoho Commerce store. A few points that seem to matter: Keep them short. 6 to 15 seconds showing the product from a few angles
      • How to embed Google Analytics GA4 tracking on a standalone Public Page (outside Customer Portal)?

        Hi, Is there an official or recommended way to embed Google Analytics (GA4) tracking directly onto a standalone public Zoho Creator Page (outside of a Customer Portal)? I’m considering using an invisible Custom JS Widget as a workaround, but I’d love
      • Unable to integrate Whatsapp Messaging into Zoho CRM - Business Messaging

        Hello, I want to set up Business Messaging in our Zoho CRM and am struggling to set it up. I have logged into the account and our facebook business page, our business shows in the dropdown for WhatsApp Business Account but does not for WhatsApp Business
      • Zoho CRM calendar merge with outlook

        Hi Zoho team! I did the steps for syncing the zoho CRM calendar with outlook. Everything works well as long as the user creates meetings inside the newly created Zoho CRM calendar in outlook, but I need a way to also display the meetings which are received
      • Thunderbird cannot authenticate Zoho on android

        I keep getting a message from Thunderbird on Android that it could not authenticate for my account, dadashton@zoho.com., and to update my server settings. Now the settings are exactly the same for my other devices (1 Windows, 1 Mac and 2 Linux) Can anybody
      • Bills import rejects the Account column (The account does not exist), although the accounts exist in the Chart of Accounts

        Hello Zoho Books Team, I am unable to import bills into my Zoho Books. The import keeps rejecting the Account column, even though the accounts exist and work when I create a bill manually. What I am doing Bills > Import Bills, CSV/XLSX file, 145 rows,
      • How do I reorder the item table columns in my invoice template?

        There must be a way I just cannot find it. Anyone?
      • Zoho Desk API returning 403 SCOPE_MISMATCH for Ticket Search API

        Hello Zoho Support Team, We are experiencing an authorization issue with the Zoho Desk Ticket Search API. Our integration was working correctly yesterday, but we are now receiving the following error when calling the Search Tickets endpoint: API: GET
      • Free webinar: Zoho Sign in Q3 2026

        Hi there! From smarter signing on your Apple devices to new ways to verify and personalize your documents, Zoho Sign had a busy Q3—and we're bringing it all together in one session. Join us for a complete walkthrough of everything new this quarter, plus
      • Zoho Desk - Delete an email conversation

        When using Zoho support desk I see an option to delete and edit conversations that are comments, BUT if the conversation was automatically added as a conversation from an email, then the option to delete it seems not to be available. Is there a way to
      • Next Page