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
Unified customer portal login
As I'm a Zoho One subscriber I can provide my customers with portal access to many of the Zoho apps. However, the customer must have a separate login for each app, which may be difficult for them to manage and frustrating as all they understand is that
WhatsApp Channels in Zoho Campaigns
Now that Meta has opened WhatsApp Channels globally, will you add it to Zoho Campaigns? It's another top channel for marketing communications as email and SMS. Thanks.
Is it possible to customize ZC Themes?
I understand you can choose a layout and customize Brand Color, App Header, Menu, and Sub-Menu components, but can you override some of the default theme settings with CSS or a config file? For example, - Table highlight color - Listview auto filter highlight
error : Object code : 6500
b3 = map(); b3.put("name", "Test Project Name"); updateprojects2 = invokeurl [ url :"https://projectsapi.zoho.eu/restapi/portal/era0130/projects/169495000000928007/" type :PUT parameters: b3 connection:"in2" ]; info b3 ; info updateprojects2; ------------
Tracking KPIs, Goals etc in People
How are Zoho People users tracking employee targets in People? For example, my marketing assistant has a target of "Collect 10 new customer testimonials every month". I want to record attainment for this target on a monthly basis, then add it to their
Text snippet
There is a nice feature in Zoho Desk called Text Snippet. It allows you to insert a bit of text anywhere in a reply that you are typing. That would be nice to have that option in Zoho CRM as well when we compose an email. Moderation Update: We agree that
Is it possible to create Custom function-based Lookup field in Zoho CRM
Is it possible to create a custom function-based lookup field in Zoho CRM? If so, how? Use case: Need to fetch users from Zoho Projects into a dropdown field in Zoho CRM.
Zoho Projects app update: Voice notes for Tasks and Bugs module
Hello everyone! In the latest version(v3.9.37) of the Zoho Projects Android app update, we have introduced voice notes for the Tasks and Bugs module. The voice notes can be added as an attachment or can be transcribed into text. Recording and attaching
Create a list of customers who participated in specific Zoho Backstage events and send them an email via Zoho CRM
How to create a list of customers who participated in specific Zoho Backstage events and send them an email via Zoho CRM? I was able to do a view in CRM based on customer that registered to an event, but I don't seems to be able to include the filter
How can I see content of system generated mails from zBooks?
System generated mails for offers or invices appear in the mail tab of the designated customer. How can I view the content? It also doesn't appear in zMail sent folder.
How to conditionally embed an own internal widget with parameters in an html snippet?
Hello everyone, I'm trying to create a dynamic view in a page using an HTML snippet. The goal is to display different content based on a URL parameter (input.step). I have successfully managed to conditionally display different forms using the following
Zadarma + Zoho CRM Integration – Missed Calls Saved as Contacts Instead of Leads
Hello everyone, I’m looking for input from anyone with experience using the Zadarma + Zoho CRM integration. Currently, I’m seeing that missed calls are automatically being created as Contacts instead of Leads. From a CRM perspective, this doesn’t make
Custom Button Disappearing in mobile view | Zoho CRM Canvas
I'm working in Zoho CRM Canvas to create a custom view for our sales team. One of the features I'm adding is a custom button that opens the leads address in another tab. I've had no issue with this in the desktop view, but in the mobile view the button
Search Records returning different values than actually present
Hey! I have this following line in my deluge script: accountSearch = zoho.crm.searchRecords("Accounts","(RS_Enroll_ID:equals:" + rsid + ")",1,200,{"cvid":864868001088693817}); info "Account search size: " + accountSearch.size(); listOfAccounts = zoho.crm.searchRecords("Accounts","(RS_Enroll_ID:equals:"
Windows Desktop App - request to add minimization/startup options
Support Team, Can you submit the following request to your development team? Here is what would be optimal in my opinion from UX perspective: 1) In the "Application Menu", add a menu item to Exit the app, as well as an alt-key shortcut for these menus
Function 56: Automatically enable the option for customers to pay via bank account
Hello everyone and welcome back to our series! One of the key features of Zoho Books is its integration with multiple payment gateways, allowing you to receive online payments for your invoices. This ensures faster payments, automates payment tracking
Attach Files to Your Notecards and share them on the go!
Hey everyone! We’re excited to share a feature many of you have been asking for — you can now attach files directly to your text notecards and share with ease! 🙌 This update was built with your feedback in mind, especially for those who wanted a simple
Can i connect 2 instagram accounts to 1 brand?
Can i connect 2 instagram accounts to 1 brand? Or Do i need to create 2 brands for that? also under what subscription package will this apply?
Workdrive on Android - Gallery Photo Backups
Hello, Is there any way of backing up the photos on my android phone directly to a specific folder on Workdrive? Assuming i have the workdrive app installed on the phone in question. Emma
Integración Books para cumplir la ley Crea y Crece y Ley Antifraude (VeriFactu)
Hola: En principio, en julio de 2025, entra en vigor la ley Crea y Crece y Ley Antifraude (VeriFactu). ¿Sabéis si Zoho va a cumplir con la ley para cumplir con la facturación electrónica conectada a Hacienda? Gracias
YouTube Live #1: AI-powered agreement management with Zia and Zoho Sign
Hi there! We're excited to announce Zoho Sign’s first YouTube live series, where you can catch the latest updates and interact with our Zoho Sign experts, pose questions, and discover lesser-known features. We're starting off by riding the AI wave in
Mass Mail Statistics - Number of unsent emails
How do I find out which emails were not sent?
How to add a % Growth column for year-over-year comparison (2024 vs 2025)
Hello, I am trying to build a monthly revenue comparison between 2024 and 2025 in Zoho CRM Analytics. My current setup is: Module: Deals (Affaires) Filter: Stage = Closed Won Date field: Closing Date Grouping: By Month Metrics: Sum of Amount for 2024,
How to searchByCriteria records that are under approval?
I need to search for both approved and pending approval records Is that possible with this method? Or I need to a different method? var priceReqID = $Page.record_id; log(priceReqID); var records = ZDK.Apps.CRM.Price_List_Item.searchByCriteria("Price_Request:equals:"
Power of Automation::Streamline log hours to work hours upon task completion.
Hello Everyone, A Custom Function is a user-written set of code to achieve a specific requirement. Set the required conditions needed as to when to trigger using the Workflow rules (be it Tasks / Project) and associate the custom function to it. Requirement:-
How to add Simple Analytics to Zoho Pages?
I have a website with Zoho Pages, how do I add Simple Analytics on it? They seem to have code they need to be embedded https://docs.simpleanalytics.com/script
Product details removed during update from other system
We maintain our product details in an other system. These details are synchronized with Zoho at the end of each day, through an API. This has worked perfectly sofar. But last Monday, all product codes and some other product data have been wiped during
End Date in Zoho Bookings
When I give my appointments a 30 minutes time I would expect the software not to even show the End Time. But it actually makes the user pick an End Time. Did I just miss a setting?
I hate the new user UI with the bar on the left
How can I reverse this?
Cant seem to delete an email account
Hello, I have researching for 4 days how to delete an email account and I am absolutely without a clue. The email account I am trying to delete is support<AT>fyshoes<dot>com. It's the first email account I made and it (is???) was associated with the super user (me). I have since changed it to adming<AT>fychoes<dot>com and I see the support email in my list but I just cant seem to get rid of it. Ultimately I want to associate that email account with another user that I want to add. This is really
Commerce Order as Invoice instead of Sales Order?
I need a purchase made on my Commerce Site to result in an Invoice for services instead of a Sales Order that will be pushed to Books. My customers don't pay until I after I add some details to their transaction. Can I change the settings to make this
Sync desktop folders instantly with WorkDrive TrueSync (Beta)
Keeping your important files backed up and accessible has never been easier! With WorkDrive desktop app (TrueSync), you can now automatically sync specific desktop folders to WorkDrive Web, ensuring seamless, real-time updates across devices. Important:
Script that deletes a record?
We're using WP Plugin "Integration for WooCommerce and Zoho Pro", and have created a couple of Feeds to send data to Zoho. We are trying to create Contact records, but only based upon condition. Tried to make it with small Deluge function and Workflow,
Introducing Profile Summary: Faster Candidate Insights with Zia
We’re excited to launch Profile Summary, a powerful new feature in Zoho Recruit that transforms how you review candidate profiles. What used to take minutes of resume scanning can now be assessed in seconds—thanks to Zia. A Quick Example Say you’re hiring
Import data into Multi-Select lookup field from CSV/Excel
How to import data into a multi-select lookup field from the CSV/Excel Sheet? Let's say I have an Accounts multi-select lookup field in the Deals module and I want to import the Deals with Accounts field. Steps:- 1. Create/edit a multi-select lookup field
Auto Capitalize First Letter of Words
Hi I am completely new to ZOHO and am trying to build a database. How can i make it when a address is entered into a form field like this: main st it automatically changes is to show: Main St Thank You
A formula that capitalises the first letter of each word
Hi all, is there a zoho formula that can capitalise the first letter of each word in a string? INITCAP only capitalises the first letter of the first word.
Add Analytics function for Title case (capitalising each word in a string)
At present, you can only capitalise each word in a string in Analytics during data import. It would be really useful to be able to do this with a formula column, but there is no Title Case function.
Office 365 and CRM mail integration: permission required
Has anyone run into this weird problem? My email server is Office 365. When I try to configure Zoho CRM to use this server, a Microsoft popup window opens requesting user and password. After entering that, I get a message in the Microsoft window saying
Updating Subform Record from other Form
Just wanted to ask how to properly approach this. I have 2 forms and would like to trigger an auto update on the subform once record submitted. block below only updates 1 row for each recordRow in input.AV_System { AssetRecord = Site_Asset_Services[SOR_No
Next Page