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

        • Trident Missing

          No way you guys get so close to having trident complete for over a year then just kill it off. Wow just wow
        • 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
        • Unable to delete domains from Zoho Campaigns

          This error occurs while deleting a domain "This domain cannot be deleted because we've found $1sender addresses associated to it." But I have no more sender addresses of this domain anymore. I can't delete the domain.
        • Automating CRM backup storage?

          Hi there, We've recently set up automatic backups for our Zoho CRM account. We were hoping that the backup functionality would not require any manual work on our end, but it seems that we are always required to download the backups ourselves, store them,
        • Feature Request: Fully customizable record layouts in Zoho FSM (movable sections and custom subform tables)

          Hi Zoho FSM Team and Community, We’d like to suggest a feature that we think would help many FSM users: full control over the layout of record detail pages, starting with the Work Order view. Current situation When you open a Work Order, its sections
        • 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
        • Why don't Zia agents support file uploads?

          I am trying to build a Zia Agent that allows uploading of a PDF file and uses the GLM5 model to process it and extract information. But agents.zoho.com has no way to enable file uploads on the agent. Additionally, GLM5 based agents keep outputting their
        • Building Toppings #10 - Using signals to build real-time notifications between Bigin and Zoho Desk

          Hello Biginners! In our previous post, we covered Bigin Variables and Widgets. In this post, we'll explore another component: Signals. To show how Signals work, we will build a real-time use case integrating Bigin and Zoho Desk. It connects Zoho Desk
        • Cliq iOS can't see shared screen

          Hello, I had this morning a video call with a colleague. She is using Cliq Desktop MacOS and wanted to share her screen with me. I'm on iPad. I noticed, while she shared her screen, I could only see her video, but not the shared screen... Does Cliq iOS is able to display shared screen, or is it somewhere else to be found ? Regards
        • ¡Gracias por acompañarnos en los Workshops de Zoho España!

          Los pasados 3 y 4 de noviembre celebramos una nueva edición de los Workshops de Zoho España en el Hotel NH Las Ventas de Madrid. Dos jornadas de formación práctica, demostraciones en directo y encuentros con expertos de Zoho en las que compartimos conocimientos,
        • Mass Update Option for Changing Work Order Owner

          Hello FSM Team/Mr. Abid, We would like to inquire if there is an option to mass update or bulk change the Owner of Work Orders in Zoho FSM. Current Situation: At the moment, the Owner of a Work Order can only be changed individually, which becomes time-consuming
        • Never miss a follow-up with personal reminder agent | Zoho Cliq AI Use Case #03

          A task mentioned mid-conversation rarely survives the conversation. Someone asks you to follow up, you say you will, and by the time you remember, the message is three hundred lines back, buried under two meetings and a dozen other threads. Personal Task
        • Calendar won't load

          I run into this problem about once a week, where I try to open my Zoho calendar in a web browser, and it just gets stuck, waiting forever to load (see attached screenshot). I'm usually using Edge or Duck-Duck-Go browser. Sometimes it loads just fine,
        • Change 'default' project dashboard

          Is it possible to change the default project dashboard for all projects? Both in layout and in what widgets are shown? We have a lot of (short-running) projects and I want to quickly see the tasks and milestones when I open a Project, but I don't want to change the layout for all my projects manually. Thanks, Menno
        • Multiple subscription plan line items in Zoho Billing quotes

          I run an IT company and sell a lot of licences. A client might have multiple subscription plans including software licences in different categories. A client might have Microsoft licences, antivirus licences, web hosting and maintenance package services.
        • [ZohoDesk] Improve Status View with a new editeble kanban view

          A kanban view with more information about the ticket and the contact who created the ticket would be valueble. I would like to edit the fields with the ones i like to see at one glance. Like in CRM where you can edit the canvas view, i would like to edit
        • Live connection to DS files in Zoho Creator / ChatGPT

          As an idea, we are using ChatGPT to build with Zoho Creator (outside of Zia), which is works brilliantly to assist write deluge, provide test suggesitons etc. Currently we are uploading the DS files which are very point in time, it would be great to have
        • 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
        • 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
        • Script to access a CBPX file from zoho crm

          Hello everyone, I'm planning to write a script in Python or Java in Zoho CRM functions, to access a CBPX file. Is it possible to write this script in the dev console of Zoho? What are the best practices to do this ? Would you have references in the Zoho
        • Calculate hours

          Is there any chance that the the "formula" will have the ability to do calculation using the "time" field in the future? Our company has a form set up for tracking hours worked and we use 2 time fields currently. One for the clock-in time, and one for the clock-out time. It's great for keeping that record, but if there were a way to calculate the hours to show on the report would be awesome. Previously we had used JotForm and their calculator had that ability, but it seems that Zoho doesn't accept
        • Introducing parent-child ticketing in Zoho Desk [Early access]

          Hello Zoho Desk users! We have introduced the parent-child ticketing system to help customer service teams ensure efficient resolution of issues involving multiple, related tickets. You can now combine repetitive and interconnected tickets into parent-child
        • Zoho Books | Product Updates | November 2026

          Hello users, As the year winds down, we've introduced several enhancements to make compliance, inventory management, and everyday bookkeeping easier in Zoho Books. This month's updates include an improved TDS experience, a new way to exchange transactions
        • Zoho Writer workflows now support custom stages, parallel reviews, and external approvers

          Hello everyone, Zoho Writer now lets you build your own approval chains. The pre-built workflows also get new review modes, completion criteria, and external approver support. What’s new Custom workflows: Design review and approval processes from scratch,
        • Expanding sales, marketing, and support capabilities in Zoho CRM Plus 3.0

          Hey everyone, It's been more than 10 years since we launched Zoho CRM Plus back in 2014. This is quite a milestone, and we've come a long way in empowering you with everything you need to offer an exceptional customer experience. On that note, we expanded
        • Erase function in Zoho PDF editor does not truly redact

          Using the "erase" function in the Zoho PDF editor online does not redact the text underneath when opening the file in Adobe. When I used the erase function to whiteout the areas I didn't want to be seen, I opened the supposed redacted files in Adobe.
        • Error creating an XML file

          I am creating an xml as string in the function Employee.generatePartA_XML_String, and then I want to save it as a file to the field "Part_A_XML", but I get the response: {"code":3700,"message":"Unable to upload a file. Please check and try again."} How
        • 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
        • Mailchimp Integration

          Hello, I am needing some help. Does anybody have a recommended source for information on the Zoho-Mailchimp integration. We are working on a system to import large amounts of records into Zoho that will sync into Mailchimp for us to run a mail campaign out of. Let me explain what the process we are trying to implement - any information or advice is appreciated. Import record data base into Zoho Leads module --> use Lead source to ID records that are part of this mail campaign Zoho Leads (specific
        • [Free webinar] Zoho Creator meets AI with MCP | Creator Tech Connect (November 2026)

          Hello everyone, We are excited to invite you to another edition of the Creator Tech Connect webinar. About Creator Tech Connect The Creator Tech Connect series is a free monthly webinar consisting of purely technical sessions, where we dive deep into
        • Invalid Client - Client ID passed does not exist

          I tried connecting the Zoho campaign with the "Uncanny Automator". It shows an error " Invalid Client - Client ID passed does not exist". There is no option to add manual API. URL: https://accounts.zoho.eu/oauth/v2/auth?response_type=code&client_id=1000.MSFIUOA1G8YBK7IFRL9Z0NINM6DW9C&scope=ZohoCampaigns.contact.ALL&redirect_uri=https%3A%2F%2Fapi.automatorplugin.com%2Fv2%2Fzoho-campaigns&prompt=consent&access_type=offline
        • Field of Lookup - 5 Field Association Limit.

          This query relates to the post at: https://help.zoho.com/portal/en/community/topic/introducing-the-field-of-lookup-in-crm-public-early-access-2023 My simple (and common) scenario: I select an account / customer lookup and want their address pulled into
        • Task status - completed - other options

          I have a dumb question I know i can make custom statuses for the tasks - but is there anyway to make additional "completed" statuses like for instance if i have a task "call back customer" and i leave a vm for them to call back marking it "completed -
        • #20 I've Sent It and It's Wrong

          Meera spots a mistake in an invoice just four minutes after sending it. She has billed a photoshoot at the half-day rate instead of the full-day rate. Her first thought is to delete the invoice and start again. But is deleting the right thing to do? It
        • Zoho Forms API

          Is there any way to get all form entry list using API? Looking forward to hear from you
        • BNZ Bank Feeds No Longer Available

          The BNZ (New Zealand) bank feeds are still failing and it's been months since they last worked! Uploading bank statements (CSV's) mean waiting to the end of the month when they become available. It is unacceptable to keep my clients waiting for payment
        • MCP is now easier to access and configure in Bigin

          Greetings! We hope you're all doing well. We've previously introduced Zoho MCP for Bigin, which lets you connect Bigin with AI tools and interact with your Bigin data using natural language. Now we're making MCP easier to access and configure directly
        • Launch agents from more custom button locations and attach files in Ask Zia

          Hello all, Your agents now meet your team where the work happens. You can add agents to custom buttons in list views, create and edit pages, and related lists, so users launch them without leaving the page they’re on. What’s new Agents in more custom
        • Phone system to integrate with Zoho CRM

          I am looking for phone software that would allow my agency to do the following within Zoho CRM: Make calls from zoho Track calls and notes Leave pre-recorded messages after reaching voicemail of lead Only 2 members, so need company who will allow just
        • Introducing PRM: Build, manage, and scale your partner ecosystem

          Growing a partner ecosystem is a good problem to have. What starts as a handful of partners can quickly turn into a maze of spreadsheets, emails, and disconnected processes. More partners mean more opportunities, greater reach, and new ways to grow
        • Next Page