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
Rename Record Summary PDF in SendMail task
So I've been tasked with renaming a record summary PDF to be sent as part of a sendmail task. Normally I would offer the manual solution, a user exports the PDF and uploads it to a file upload field, however this is not acceptable to the client in this
in zoho creator Sales Returns form has sub form Line Items return quantity when i upate the or enter any values in the sub form that want to reflect in the Sales Order form item deail sub form field Q
in zoho creator Sales Returns form has sub form Line Items return quantity when i upate the or enter any values in the sub form that want to reflect in the Sales Order form item deail sub form field Quantity Returned\ pls check the recording fetch_salesorder
Estimates with options and sub-totals
Hi It seems it would be great to be able to show multiple options in an estimate. For instance I have a core product to which I can add options, and maybe sub-options... It would be great to have subtotals and isolate the core from the not compulsory items. Thanks
Optional Items Estimate
How do you handle optional items within an estimate? In our case we have only options to choose with. (Like your software pricing, ...standard, professional, enterprise) How can we disable the total price? Working with Qty = 0 is unprofessional....
Important Update : Zendesk Sell announced End of Life
Hello Zendesk users, Zendesk has officially announced that Zendesk Sell will reach its End of Life (EOL) on August 31, 2027 (Learn more). In line with this deprecation, Zoho Analytics will retire its native Zendesk Sell connector effective October 1,
Zoho Sheets
Hi, I am trying to transition into Zoho sheets, I have attached the issues encountered. Server issues, file trying to upload for more than 30 mins, even once uploaded my data aren't loaded. Simple calculations are not working I have attached the sample.
Zoho CRM + Zoho FSM : alignez vos équipes commerciales et techniques
La vente est finalisée, mais le parcours client ne fait que commencer ! Dans les entreprises orientées service, conclure une vente représente seulement la première étape. Ce qui suit — installation, réparation ou maintenance régulière — influence grandement
Top Bar Shifting issue still not fixed yet
I mentioned in a previous ticket that on Android, the top bar shifts up when you view collections or when you're in the settings. That issue still hasn't been fixed yet. I don't wanna have to reinstall the app as I've noticed for some reason, reinstalling
Power of Automation:: Automate the process of updating project status based on a specific task status.
Hello Everyone, Today, I am pleased to showcase the capabilities of a custom function that is available in our Gallery. To explore the custom functions within the Gallery, please follow the steps below. Click Setup in the top right corner > Developer
ZOHO SHEETS
Where can I access desktop version of zoho sheets? It is important to do basic work If it is available, please guide me to the same
Attention API Users: Upcoming Support for Renaming System Fields
Hello all! We are excited to announce an upcoming enhancement in Zoho CRM: support for renaming system-defined fields! Current Behavior Currently, system-defined fields returned by the GET - Fields Metadata API have display_label and field_label properties
Billing Management: #3 Billing Unbilled Charges Periodically
We had a smooth sail into Prorated Billing, a practice that ensures fairness when customers join, upgrade, or downgrade a service at any point during the billing cycle. But what happens when a customer requests additional limits or features during the
No bank feeds from First National Bank South Africa since 12 September
I do not know how Zoho Books expects its customers to run a business like this. I have contacted Zoho books numerous times about this and the say it is solved - on email NO ONE ANSWERS THE SOUTH AFRICAN HELP LINE Come on Zoho Books, you cannot expect
Citation Problem
I had an previous ticket (#116148702) on this subject. The basic problem is this; the "Fetch Details" feature works fine on the first attempt but fails on every subsequent attempt, Back in July after having submitted information electronically and was
Open Sans Font in Zoho Books is not Open Sans.
Font choice in customising PDF Templates is very limited, we cannot upload custom fonts, and to make things worse, the font names are not accurate. I selected Open Sans, and thought the system was bugging, but no, Open Sans is not Open Sans. The real
Failing to generate Access and Refresh Token
Hello. I have two problems: First one when generating Access and Refresh Token I get this response: As per the guide here : https://www.zoho.com/books/api/v3/#oauth (using server based application) I'm following all the steps. I have managed to get
Zeptomail 136.143.188.150 blocked by SpamCop
Hi - it looks like this IP is being blocked, resulting in hard bounces unfortunately :( "Reason: uncategorized-bounceMessage: 5.7.1 Service unavailable; Client host [136.143.188.150] blocked using bl.spamcop.net; Blocked - see https://www.spamcop.net/bl.shtml?136.143.188.150
Apply transaction rules to multiple banks
Is there any way to make transaction rules for one bank apply to other banks? It seems cumbersome to have to re-enter the same date for every account.
How to bulk update records with Data Enrichment by Zia
Hi, I want to bulk update my records with Data Enrichment by Zia. How can I do this?
Need Guidance on SPF Flattening for Zoho Mail Configuration
Hi everyone, I'm hoping to get some advice on optimizing my SPF record for a Zoho Mail setup. I use Zoho Mail along with several other Zoho services, and as a result, my current SPF record has grown to include multiple include mechanisms. My Cloudflare
How do I split a large CSV file into smaller parts for import into Zoho?
Hi everyone, I’m trying to upload a CSV file into Zoho, but the file is very large (millions of rows), and Zoho keeps giving me errors or takes forever to process. I think the file size is too big for a single import. Manually breaking the CSV into smaller
Client Script Payload Size Bug
var createParams = { "data": [{ "Name": "PS for PR 4050082000024714556", "Price_Request": { "id": "4050082000024714556" }, "Account": { "id": "4050082000021345001" }, "Deal": { "id": "4050082000023972001" }, "Owner": { "id": "4050082000007223004" }, "Approval_Status":
Sync Issue Between Zoho Notebook Web App on Firefox (PC) and Android App
Hi Zoho Notebook Community, I'm facing a sync problem with Zoho Notebook. When I use the web version on Mozilla Firefox browser on my PC, I create and save new notes, and I've synced them successfully. However, these new notes aren't showing up in my
Messages not displayed from personal LinkedIn profile
Hello. I connected both our company profile and my personal profile to Zoho social. I do see all messages from our company page but none from my private page. not even the profile is being added on top to to switch between company or private profile,
lead convert between modules
Hello, The workflow we set up to automatically transfer leads registered via Zapier into the Patients module to the Leads module started to malfunction unexpectedly on September 25, 2025, at 11:00 AM. Under normal circumstances, all fields filled in the
Flow Task Limits - How to Monitor, Understand Consumption?
So, I got an email last night saying that I've exhausted 70% of my tasks for this month, and encouraging me to buy more tasks. I started to dig into this, and I cannot for the life of me figure out where to find any useful information for understanding,
Cross References Do Not Update Correctly
I am using cross references to reference Figures and current am just using the label and number, i.e. Figure #. As seen here: When I need to update the field, I use the update field button. But it will change the cross reference to no longer only including
Manage control over Microsoft Office 365 integrations with profile-based sync permissions
Greetings all, Previously, all users in Zoho CRM had access to enable Microsoft integrations (Calendar, Contacts, and Tasks) in their accounts, regardless of their profile type. Users with administrator profiles can now manage profile-based permissions
How to Track and Manage Schedule Changes in Zoho Projects
Keeping projects on track requires meticulous planning. However, unforeseen circumstances can cause changes to schedules, leading to delays. It becomes important to capture the reason for such changes to avoid them in the future. Zoho Projects acknowledges
Is there a notification API when a new note is addeding
Trying to push to Cliq, or email notification when there's a new note added in module. How to implement this?
Zoho Sheet - Desktop App or Offline
Since Zoho Docs is now available as a desktop app and offline, when is a realistic ETA for Sheet to have the same functionality?I am surprised this was not laucned at the same time as Docs.
Collaborate Feature doesn't work
Hello Team. It seems that the collaborate section is broken? I can post something but it all appears in "Discussions". In there is no way how I would mark something as Draft, Approval, post or any of the other filter categories? Also if I draft a post
Edit Permission during and after approval?
When a record is sent for approval Can a user request for edit permission from the approver? We don't want to give edit permissions for all the records under approval Only on a case-by-case basis How can we achieve this?
Zoho web and mobile application not workingn
Both zoho forms web and mobile application aren't working. I have checked my network connections and they are fine.
Introducing the revamped What's New page
Hello everyone! We're happy to announce that Zoho Campaigns' What's New page has undergone a complete revamp. We've bid the old page adieu after a long time and have introduced a new, sleeker-looking page. Without further ado, let's dive into the main
Prevent stripping of custom CSS when creating an email template?
Anyone have a workaround for this? Zoho really needs to hire new designers - templates are terrible. A custom template has been created, but every time we try to use it, it strips out all the CSS from the head. IE, we'll define the styles right in the <head> (simple example below) and everything gets stripped (initially, it saves fine, but when you browse away and come back to the template, all the custom css is removed). <style type="text/css"> .footerContent a{display:block !important;} </style>
Bulk Moving Images into Folders in the Library
I can't seem to select multiple images to move into a folder in order to clean up my image library and organize it. Instead, I have to move each individual image into the folder and sometimes it takes MULTIPLE tries to get it to go in there. Am I missing
Latest updates in Zoho Meeting | Breakout rooms and End to end encryption
Hello everyone, We’re excited to share a few updates for Zoho Meeting. Here's what we've been working on lately: Introducing Breakout Rooms for enhanced collaboration in your online meetings and End-to-end encryption to ensure that the data is encrypted
Systematic SPF alignment issues with Zoho subdomains
Analysis Period: August 19 - September 1, 2025 PROBLEM SUMMARY Multiple Zoho services are causing systematic SPF authentication failures in DMARC reports from major email providers (Google, Microsoft, Zoho). While emails are successfully delivered due
Accidentally deleted a meeting recording -- can it be recovered?
Hi, I accidentally deleted the recording for a meeting I had today. Is there a way I can recover it?
Next Page