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

    • 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
    • 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
    • #22 I Sent It to the Wrong Person

      Meera was sending an invoice to a client when she mistyped the email address. She noticed the mistake a week later, when the payment had not come in. She corrected the email address on the customer record and waited for the payment to arrive. But nothing
    • Build a historical inventory snapshot in Google BigQuery using Zoho DataPrep

      Businesses using Zoho Inventory may want to transfer their inventory data to Google BigQuery to maintain an up-to-date data warehouse. While scheduled pipelines help keep BigQuery updated with the latest inventory data, businesses that also need to track
    • Zoho writer tabs

      I'm trying to post a list of actions for my team to share online. For this I need to set tabs -- can't find a way of setting tabs anywhere. Would prefer not to go to the formality of a table. Can anyone tell me how to set tabs? greigg
    • Ability to Set Text Direction for Individual Cells in Zoho Sheet

      Dear Zoho Sheet Team, We hope you are doing well. We would like to request an enhancement in Zoho Sheet that allows users to set the text direction (right-to-left or left-to-right) for individual cells, similar to what is available in Google Sheets. Use
    • Keep Zoho Books data in sync with Google BigQuery

      Businesses using Zoho Books may need to transfer their financial data to a data warehouse like Google BigQuery for reporting and analysis. Zoho DataPrep helps automate this process by preparing Zoho Books data and syncing it with BigQuery at scheduled
    • What's New - October 2026 | Zoho Backstage

      Hello everyone, The last few months of the year are usually the busiest for events, with more people to reach and more details to manage. This month, we’ve made a few changes that should save you some time and back-and-forth along the way. Here’s what’s
    • Introducing user-based authentication across Zoho CRM

      We have introduced two enhancements to simplify authentication and enable user-specific access when working with Connections and executing CRM operations across different developer tools. 1. Enable user-based authentication for Connections Connections
    • Set connection link name from variable in invokeurl

      Hi, guys. How to set in parameter "connection" a variable, instead of a string. connectionLinkName = manager.get('connectionLinkName').toString(); response = invokeurl [ url :"https://www.googleapis.com/calendar/v3/freeBusy" type :POST parameters:requestParams.toString()
    • Allow Multiple usage units to items while adding them to sales/purchase transactions

      The usage unit of items added in zoho books are static right now and can not be changed. But certain items are received or sold in multiple usage units. One example is fabric. It can be bought in Meters, inches, kgs or other units. Another example would
    • Zoho Inventory – Stock Allocation and Warehouse ManagementAs we implement Zoho One in our organization, we are currently facing a challenge with stock allocation and warehouse management. While the wa

      As we implement Zoho One in our organization, we are currently facing a challenge with stock allocation and warehouse management. While the warehouse management part can be handled in Zoho Inventory, our main requirement is the customer-wise stock allocation
    • How to restore deleted campaigns?

      I accidentally deleted my first campaign that went out today (08/21/18). How do I restore it?
    • 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
    • New in Cadences: Option to Resume or Restart follow-ups when re-enrolling records into a Cadence, and specify custom un-enrollment criteria

      Managing follow-ups effectively involves understanding the appropriate timing for reaching out, as well as knowing when to take a break and resume later, or deciding if it's necessary to start the follow-up process anew. With two significant enhancements
    • Automatic Invoice Number generation for createRecord

      Hello, while testing some custom Buttons in my Zoho Books application, I noticed that I get an error that previously did not occur. After some further digging I found that the automatic transaction numbering of invoices no longer work in my organization.
    • Stop completed task lists from disappearing?

      Is there any way to stop projects from making tasks lists disappear when all the tasks in the list are completed? That's one of those little things where we're constantly fighting the product. For instance we have some projects which are ongoing - no start and end date. We use Kanban view to show the various task lists. We don't want the kanban list to disappear every time the items on it happen to be closed out. Thanks
    • Approval Processes, Now in Standard and Professional

      We encourage existing Approval Process users to switch to the new UI to access enhanced capabilities, including naming each rule and stage, setting stage-specific field updates and tasks, sending email notifications upon rejection, and tracking progress
    • Zoho Inventory - Backorder Report

      I am requesting a backorder report in Zoho Inventory to show all backorders by Sales Order and/or Customer, including the quantity of each line item ordered and quantity fulfilled. This is important for businesses who operate a lean business model and
    • Can we do Image swatches for color variants?

      We want to do something like the attached screenshot on our new zoho store. We need image swatches instead of normal text selection. We want to user to select an image as color option. Is this doable? I don't see any option on zoho backend. Please h
    • Email-Data Synchronization with Zoho Analytics

      Hello everyone, Thanks to Chad and everyone who shared their feedback. We're excited to announce support for email data synchronization with Zoho Analytics. We have been working hard to bring this highly requested feature to life, and we'd like to walk
    • Update on Using Extensions in Custom Modules

      Extensions in Zoho Projects now support custom modules. You can add extensions to custom module records and configure where each extension appears and who can access it during installation. Supported Extensions: Checklist, Google Drive, SharePoint Configure
    • 【初開催】Zoho Mail / Workplace 活用勉強会 |11/27オンライン・無料

      ユーザーの皆さま、こんにちは。 ゾーホージャパンの中野です。 11月27日(金)、Zohoコミュニティでは初めてとなる「Zoho Mail / Workplace 活用勉強会」をオンラインで開催します! すでにZoho Mail / Workplaceをご利用中の方はもちろん、Zoho Oneをご利用中で、Zoho Mailの利用を検討している方も歓迎です。 Zoho社員が製品の概要に触れながら、具体的な利用場面に沿って活用方法をご紹介します。 ■ メール対応のミスや手間を減らす 添付忘れや誤送信の対策など、日々のメール業務に役立つ便利機能を取り上げます。
    • 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
    • Breaking Change Announcement: Users API Response Restricted for Client Portal Users

      Hi all, We are introducing a breaking change to the Users API when it is accessed by Client Portal users. Status: Live This change is now live in production. Please review your integrations and make the necessary updates. Affected endpoints: GET /users
    • automatic email reminder

      in need of an email reminder to participants having trained for a course but have not paid
    • Sharedmail box access via an api

      Hi, I am trying to access a sharedmailbox via an API. I am the moderator and creator of this shared mailbox. I have created a self client but when when i try to get list of all emails, it does not list the sharedmailbox. Help me to resolve this or provide
    • 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
    • Hiding old CRM Contacts in Desk

      I have an issue with contacts in Desk.   We sync contacts from CRM with DESK and we have old contacts, eg staff members that have left businesses.  The issue is when adding a ticket (most of our tickets are raised over the phone), staff sometimes pick
    • CC'd User Receiving Both Regular Email Chain Response & Reply Notification

      Hi, I am trying to set up the notifications for users and I'm a bit confused. I'm testing with personal accounts and my Desk agent, and I'm noticing that CC'd users are receiving both the regular email chain that the requester (contact) receives, but
    • Default View for Email Sent

      Hi, can the default view for email sent to candidates be "ALL" instead of the current user? I have to click the dropdown menu every time so that I can see if other recruiters have already sent an email to a candidate.  Thanks!
    • 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
    • Enable Screen Recording in Zoho WorkDrive Mobile Apps (Android & iOS)

      Hi Zoho WorkDrive Team, How are you? We are enthusiastic Zoho One users and rely heavily on Zoho WorkDrive for internal collaboration and content sharing. The screen-recording feature in the WorkDrive web app (similar to Loom) is extremely useful- however,
    • Add Comprehensive Accessibility Features to Zoho Writer

      Hello Zoho Writer Team, We hope you are doing well. We would like to submit a feature request to enhance Zoho Writer with a full set of accessibility tools, similar to the accessibility options already available in the Zoho Desk agent interface. 🚧 Current
    • Problem with currency field in Zoho CRM

      Hi Guys Zoho Books has a feature in currency fields that automatically converts decimal numbers with commas ( , ) to period format ( . ) when pasting them. For example: R$ 2,50 --> R$ 2.50 Is this behavior available in Zoho CRM? I couldn't find any configuration
    • Ability to Attach Images When Reporting Issues to Zoho Projects from Zoho Desk

      Hi Zoho Desk Team, Hope you’re doing well. We’re using the Zoho Desk–Zoho Projects integration to report bugs directly from support tickets into the Zoho Projects issue tracker. This integration is extremely useful and helps us maintain smooth coordination
    • Is it possible to convert regular pick-list to multi-select pick list?

      I have a regular drop-down pick-list and we realized that we need this info as a multi-select pick-list.  I don't think there is a way to convert from one type to the other, but what is the simplest way of moving the data over?  Meaning, whatever value
    • Make Camera Overlay & Recording Controls Visible in All Screen-Sharing Options

      Hi Zoho WorkDrive Team, Hope you are doing well. We would like to request an improvement to the screen-recording experience in Zoho WorkDrive. Current Limitation: At the moment the recording controls are visible only inside the Zoho WorkDrive tab. When
    • VENDORS ARE NOT SYNCHED WITH CONTACTS IN CRM

      Hello, While the ACCOUNTS and CONTACTS (Including the primary contact) are synced with the CONTACTS module in CRM, the vendor's CONTACTS are not synced with CRM - which basically forces the users to re-enter all vendor's contacts twice and then update
    • Properly Capture Dropdowns & Hover Elements When Recording a Window/Tab

      Hi Zoho WorkDrive Team, Hope you are doing great. We encountered a limitation when recording a selected window or browser tab: Certain UI elements, such as dropdown lists, hover menus, and overlays, are not captured unless we record the entire screen.
    • Next Page