Hello all!!
Welcome back to another post in the Kaizen series!
Query API lets you query for records based on queries using the CRM Object Query Language(COQL). COQL is based on the SQL query syntax, and supports the SELECT query to fetch records. Using this API, you can query for data across different modules that are linked using lookup fields.
1. Why did I get a SYNTAX error for the following query?
{ "select_query":"select External from Contacts where id is not null" }
|
Answer:
The error occurs because the query uses an SQL reserved keyword, "External", as a column name without enclosing it in quotes. When using SQL reserved keywords like "External", you must enclose them in single or double quotes.
The above-query can be written as:
{ "select_query":"select 'External' from Contacts where id is not null" }
|
------------------------------------------------------------------------------------------------------------------------------------
2. Why does the following query throw an error?
{ "select_query":"select id from Contacts where id is not null and Account_Name is not null and Vendor_Name is not null" }
|
Answer:
When the query involves more than two criteria, ensure that you enclose your criteria properly by grouping them in pairs, such as ((A and B) and C).
The above-query can be written as:
{ "select_query": "select id from Contacts where ((id is not null and Account_Name is not null) and Vendor_Name is not null)" }
|
------------------------------------------------------------------------------------------------------------------------------------
3. How to escape single quotes within single quotes and double quotes within double quotes?
Answer:
For single quote:
If you want to retrieve a value that contains a single quote, for example, 1' 2 in the Designation field (a single-line field), you need to escape the single quote in the value by adding another single quote.
Example:
1'' 2
Sample Input and Response:
For double quotes:
If you want to retrieve a value which contains double quotes, for example, 1' ' 2 in the Designation field (any single-line field), then you have to escape each double quotes with backslash (\) in the value.
------------------------------------------------------------------------------------------------------------------------------------
4. Why does the following query throw an error?
{ "select_query":"select What_Id->Leads.Last_Name from Tasks where id is not null" }
|
Answer:
Special characters such as "-", ">" "*", and "!" in a query must be enclosed within quotes, either in single or double quotes.
Your query can be written as:
{ "select_query":"select 'What_Id->Leads.Last_Name' from Tasks where id is not null" }
|
------------------------------------------------------------------------------------------------------------------------------------
5. How can I retrieve records from a subform module using COQL?
Answer:
------------------------------------------------------------------------------------------------------------------------------------
6. How to retrieve Multi Select lookup field data using COQL?
Answer:
------------------------------------------------------------------------------------------------------------------------------------
7. Can I query more than 50,000 records?
Answer:
Up to V6, you can retrieve up to 10,000 records without changing the criteria by using the LIMIT and OFFSET in your query. When retrieving the initial 10,000 records, make an API call with Created_Time, Modified_Time, or ID in the ORDER BY clause. To fetch more than 10,000 records, apply a condition based on the fields used in the initial ORDER BY clause in the query.
From V7 onwards, we support retrieving up to
1,00,000 records without changing the criteria by using LIMIT and OFFSET in your query. To fetch more than 1,00,000 records, please refer to the
Pagination section for more details.
------------------------------------------------------------------------------------------------------------------------------------
8. Is territory field supported in COQL?
Answer:
Yes, you can use the territory field in the COQL from V7. Refer to the
Territories section in COQL document for sample.
------------------------------------------------------------------------------------------------------------------------------------
9. Is CVID support provided in COQL?
Answer:
Yes, from V7, you can use the CVID in your query. Refer to the
CVID section in the COQL document for details.
------------------------------------------------------------------------------------------------------------------------------------
10. What are the supported aggregate functions, and why do they not work with values like Avg or avg?
Answer:
The aggregate functions are case-sensitive and only work when specified in all capital letters. Using values like Avg or avg will result in an error.
The supported aggregate functions are MIN, MAX, AVG, SUM, and COUNT.
------------------------------------------------------------------------------------------------------------------------------------
11. Are other SQL-related functions like CONCAT or DATE() supported in COQL?
Answer:
No, COQL in Zoho CRM API Version 7 currently supports only aggregate functions and does not include other SQL-related functions like CONCAT or DATE().
------------------------------------------------------------------------------------------------------------------------------------
12. Is it possible to select more than 50 fields in the SELECT column?
Answer:
------------------------------------------------------------------------------------------------------------------------------------
13. Can Multi-Module Lookup inner fields be queried?
Answer:
Yes, you can query fields from the associated module in a Multi-Module Lookup (e.g., Appointments module).
Use the following format:
select 'What_Id->{associated_module_API_name}.{field_API_name_from_associated_module}'
Example:
{ "select_query": "select 'What_Id->Leads.Last_Name','What_Id->Accounts.Account_Type' from Events where id is not null" }
|
Note:
------------------------------------------------------------------------------------------------------------------------------------
14. Is Display Name available for all types of lookup fields?
Answer:
From V7, the display name is available for Lookup and User Lookup fields when you specify them in the SELECT column, but it is not available for Consent Lookup and Multi-Module Lookup (MML) fields.
Please note, for the Users module, only the "last_name" is shown as the display field for the Users module is last_name.
Example:
{ "select_query": "select Account_Name, Owner, Data_Processing_Basis_Details from Contacts where Data_Processing_Basis_Details is not null" }
|
Response:
{ "data": [ { "Owner": { //user lookup field "name": "Boyle", "id": "5725767000000411001" }, "Account_Name": { //lookup field "name": "Zoho", "id": "5725767000003464060" }, "Data_Processing_Basis_Details": { //consent lookup field "id": "5725767000005083039" }, "id": "5725767000005091053" } ], "info": { "count": 1, "more_records": false } }
|
------------------------------------------------------------------------------------------------------------------------------------
15. Is it possible to get a Full Name based on User Preference?
Answer:
The Full Name field is supported in the Leads, Contacts, and Users modules.
Leads and Contacts modules:
- Below V7: You must query the first_name and last_name fields separately and concatenate them to form the Full Name.
- From V7: You can directly query the full_name field in the SELECT column, and it will return data based on the User Preference.
Users module:
In all versions, the full_name field is not directly supported. You need to query the first_name and last_name fields separately and concatenate them to construct the Full Name.
------------------------------------------------------------------------------------------------------------------------------------
16. Is it possible to use Profile Image and Rollup Summary fields in criteria?
Answer:
------------------------------------------------------------------------------------------------------------------------------------
17. Which fields are restricted in all clauses?
Answer:
The following fields are restricted from being included in all columns:
- Multi-select lookup fields: These cannot be queried directly from the parent module. Instead, query them from their respective linking modules.
- Line items: Pricing_Details and Product_Details
- Pricing_Details: This field cannot be queried as it is not a subform but a separate section.
- Product_Details: This is a subform. You cannot query data from the parent module. Instead, query it directly from the respective subform module.
- Participants in the Events module.
- File/Image upload fields
- Availability Information fields in the Services module
- Choose Date(s)
- Choose Day(s)
Check the following image for reference.
------------------------------------------------------------------------------------------------------------------------------------
18. Which fields are restricted only in criteria?
Answer:
The following fields have restrictions when used in criteria:
- Multiline fields: Cannot be used in criteria.
- Encrypted numeric fields: Support limited comparators (is null, is not null, =, != ).
- Encrypted non-numeric fields: Support only is null and is not null comparators.
------------------------------------------------------------------------------------------------------------------------------------
19. Which fields are restricted only in the Group By clause?
Answer:
Encrypted fields are restricted from being used in the Group By clause.
------------------------------------------------------------------------------------------------------------------------------------
20. Which fields are restricted only in the ORDER BY clause?
Answer:
Encrypted fields are restricted from being used in the ORDER BY clause.
------------------------------------------------------------------------------------------------------------------------------------
21. Is External ID supported in COQL?
Answer:
Yes,
External ID has been supported from
Zoho CRM API's Version 4. Please note that operators such as
"is null" and
"is not null" are not supported in the criteria when using
External ID.
Supported operators are "=", "!=", "in" and "not in".
------------------------------------------------------------------------------------------------------------------------------------
22. How to resolve a 408 error (Request Timeout)?
Answer:
If your query takes more than a second to parse, a request timeout error will occur.
To avoid this, ensure the query is not overly complex and that all parentheses are properly balanced. Simplifying the query or fixing any mismatched parentheses can help resolve the issue.
------------------------------------------------------------------------------------------------------------------------------------
23. Is it necessary to query the records based only on the User Time Zone?
Answer:
No, users can query records based on any time zone. However, the response will always be returned in the time zone of the user who made the query.
------------------------------------------------------------------------------------------------------------------------------------
24. Which fields are restricted when using aggregate functions, for example, SUM(field_API_name)?
Answer:
Encrypted fields are restricted and cannot be used in the aggregate functions like SUM, AVG, MIX, or MAX.
------------------------------------------------------------------------------------------------------------------------------------
25. Where can we use Alias?
Answer:
Alias can be used in the SELECT clause and in the ORDER BY clause. You can assign an alias in the SELECT clause, and the assigned alias can be referenced in the ORDER BY clause. But you cannot assign an alias directly in the ORDER BY clause.
Note: Alias cannot be used in the other clauses, such as WHERE and GROUP BY.
------------------------------------------------------------------------------------------------------------------------------------
We trust that this post meets your needs and is helpful.
Stay tuned for more insights in our upcoming Kaizen posts!

Other FAQs in Kaizen
Cheers!!!
✨Happy 2025 ✨
Recent Topics
👋 Welcome to the Zoho MCP Community
Hello all, glad to have you here! This is your space for everything AI agents, MCP tools, and intelligent business apps. This community is for you — developers, partners, creators, and businesses exploring how agents can transform work. Whether you’re
Suitability of Zoho One (Single User License) for Multi-State GST Compliance & Cost Analysis
Hello Zoho Team, I am an e-commerce business owner selling on platforms like Amazon, Flipkart, and Meesho, and I'm currently using their fulfillment warehouses. I have two GSTIN registrations and am planning to register for an additional 2-3 to expand
DNS Manager
Where Can I find my DNS manager so I can link this to click funnels or AWEBER
Forwarder
Hi, I tried to add a forwarder from which emails are sent to my main zoho account email . However, it asks me for a code that should be received at the forwarder email, which is still not activated to send to my zoho emial account. So how can I get the
Forwarder
Hi, I tried to add a forwarder from which emails are sent to my main zoho account email . However, it asks me for a code that should be received at the forwarder email, which is still not activated to send to my zoho emial account. So how can I get the
How do I sync multiple Google calendars?
I'm brand new to Zoho and I figured out how to sync my business Google calendar but I would also like to sync my personal Google calendar. How can I do this so that, at the very least, when I have personal engagements like doctor's appointments, I can
Need to extract date from datetime field
I have a datetime field and need only the date part from it. I am unable to find a built-in function that would be <DateTime>.Date(). I don't think I want to go the string conversion route of converting the datetime to string and then parsing out values and create a date out of it. Any one out there has a better solution to this? Thanks in adavnce. Regards Moiz Tankiwala Smart Training & IT Solutions
How to Hide Article Links in SalesIQ Answer Bot Responses
I have published an article in SalesIQ, and the Answer Bot is fetching the data and responding correctly. However, it is also displaying the article link, which I don’t want. How can I remove the link so that only the message is shown?
New in Cadences: WhatsApp follow-ups, upgraded limits, and options for add-ons
Hello everyone, We're rolling out two key updates to help you engage better and scale smarter with Cadences in Zoho CRM. Reach customers on WhatsApp, directly from Cadences Previously, Cadences have enabled you to automate follow-ups through emails, calls,
additional accounts
If I brought 5 emails to my account. Can I later buy additional emails.
Issue in Zoho People Regularization – Incorrect Hour Calculation
I have noticed that when applying attendance regularization in Zoho People for previous dates, the total working hours are not calculated correctly. For example, even if the check-in is 10:00 AM and check-out is 6:00 PM, the system shows an incorrect
Why I am unable to configure Zoho Voice with my Zoho CRM account?
I have installed Zoho Voice in my Zoho CRM, but as per the message there is some config needed in Zoho Voice interface. But when I click on the link given in the above message, I get an access denied page.
Issue with Hour Calculation in Zoho People Attendance Module
I have noticed an issue in the attendance regularization feature of Zoho People. When trying to regularize past dates, the total working hours are not calculated correctly. For example, if I enter a check-in and check-out time for a previous day, the
Cliq Meeting Calls No Audio and Screen Share
When in a Cliq channel meeting, the audio does not work at all on pc. When i use my phone as audio source, screen share on pc does not work. I have updated audio drivers but the strangest thing is that during a 1 on 1 call, it works well. Therefore the
Bug in Total Hour Calculation in Regularization for past dates
There is a bug in Zoho People Regularization For example today is the date is 10 if I choose a previous Date like 9 and add the Check in and Check out time The total hours aren't calculated properly, in the example the check in time is 10:40 AM check
Work anniversary and birthdays on connect
Hello, I like the idea of having employee's work anniversary and birthdays on the dashbaord. Do you have to have the employee complete this information themselves in connect settings, or does it pull from their directory settings? (ie. we use Zoho one
Alias Email Id already exists
Hi I'm trying to create an alias : contact @ yoavarielevy.co.il but i get the message Alias Email Id already exists I had an account with the same name but I deleted it. Can you help? Thanx Yoav
BANK FEED - MAYBANK , provider from YODLEE IS NOT WORKING
As per topic, the provider YODLEE is not working for the BANK FEED. It have been reported since 2023 Q3, and second report on 2023 Q4. now almost end of 2024 Q1, and coming to 2024 Q2. Malaysia Bank Maybank is NOT working. can anyone check on this issue?
Feature Request: Ability to Set a Custom List View as Default for All Users
Dear Zoho CRM Support Team, We would like to request a new feature in Zoho CRM regarding List Views. Currently, each user has to manually select or favorite a custom list view in order to make it their default. However, as administrators, we would like
Adding Multiple Products (Package) to a Quote
I've searched the forums and found several people asking this question, but never found an answer. Is ti possible to add multiple products to a quote at once, like a package deal? This seems like a very basic function of a CRM that does quotes but I can't
Zoho Commerce in multiple languages
When will you be able to offer Zoho Commerce in more languages? We sell in multiple markets and want to be able to offer a local version of our webshop. What does the roadmap look like?
webinar registration confirmation are landing in SPMA folders
I am trialing zoho webinar and do not have access to custom domains. When I test user registrations, they are working but the resulting confirmation email is landing in a spam folder. How can I avoid this?
Making digital signatures accessible to all: Introducing accessibility controls in Zoho Sign
Hi there! At Zoho Sign, we are committed to building an inclusive digital experience for all our users. As part of our ongoing efforts to align with Web Content Accessibility Guidelines (WCAG), we’re updating the application with support that will go
Is there a way to set Document Owner/Sender via the API
When sending requests for zoho sign, it would seem zoho uses the id of the person that created the zoho api cred to determine the owner_id, is there a way to set a default for this?
Delegates should be able to delete expenses
I understand the data integrity of this request. It would be nice if there was a toggle switch in the Policy setting that would allow a delegate to delete expenses from their managers account. Some managers here never touch their expense reports, and
Add Save button to Expense form
A save button would be very helpful on the expense form. Currently there is a Save and Close button. When we want to itemize an expense, this option would be very helpful. For example, if we have a hotel expense that also has room service, which is a
Multiple organizations under Zoho One
Hello. I have a long and complicated question. I have a Zoho One account and want to set it up to serve the needs of 6 organizations under the same company. Some of the Zoho One users need to be able to work in more than 1 organization’s CRM and other
Error AS101 when adding new email alias
Hi, I am trying to add apple@(mydomain).com The error AS101 is shown while I try to add the alias.
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
Regarding the integration of Apollo.io with Zoho crm.
I have been seeing for the last 3 months that your Apollo.io beta version is available in Zoho Flow, and this application has not gone live yet. We requested this 2 months ago, but you guys said that 'we are working on it,' and when we search on Google
MTD SA in the UK
Hello ID 20106048857 The Inland Revenue have confirmed that this tax account is registered as Cash Basis In Settings>Profile I have set ‘Report Basis’ as “Cash" However, I see on Zoho on Settings>Taxes>Income Tax that the ‘Tax Basis’ is marked ‘Accrual'
workflow not working in subform
I have the following code in a subform which works perfectly when i use the form alone but when i use the form as a subform within another main form it does not work. I have read something about using row but i just cant seem to figure out what to change
Fetch data from another table into a form field
I have spent the day trying to work this out so i thought i would use the forum for the first time. I have two forms in the same application and when a user selects a customer name from a drop down field and would like the customer number field in the
Record comment filter
Hi - I have a calendar app that we use to track tasks. I have the calendar view set up so that the logged in user only sees the record if they are assigned to the task. BUT there are instances when someone is @ mentioned in the record when they are not
How to View Part Inventory and Warehouse Location When Creating a Work Order in Zoho FSM
Hi everyone, We’re currently setting up Zoho FSM and would like to improve how our team selects parts when creating a Work Order. Right now, when we add a part or item to a Work Order, we can select it from our Zoho Inventory list but we don’t see any
FSM too slow today !!
Anybody else with problem today to loading FSM (WO, AP etc.)?
Not able to Sign In in Zoho OneAuth in Windows 10
I recently reset my Windows 10 system, after the reset when I downloaded the OAuth app and tried to Sign In It threw an error at me. Error: Token Fetch Error. Message: Object Reference not set to an instance of an object I have attached the screenshot
Mapping a custom preferred date field in the estimate with the native field in the workorder
Hi Zoho, I created a field in the estimate : "Preferred Date 1", to give the ability to my support agent to add a preferred date while viewing the client's estimate. However, in the conversion mapping (Estimate to Workorder), I'm unable to map my custom
The sending IP (136.143.188.15) is listed on spamrl.com as a source of spam.
Hi, it just two day when i am using zoho mail for my business domain, today i was sending email and found that message "The sending IP (136.143.188.15) is listed on https://spamrl.com as a source of spam" I hope to know how this will affect the delivery
Delegates - Access to approved reports
We realized that delegates do not have access to reports after they are approved. Many users ask questions of their delegates about past expense reports and the delegates can't see this information. Please allow delegates see all expense report activity,
Next Page