Kaizen #178 - Filters & Criteria in Zoho CRM APIs

Kaizen #178 - Filters & Criteria in Zoho CRM APIs


Hey everyone, and welcome back to another week of Kaizen!

Ever felt overwhelmed by the sheer volume of data in your Zoho CRM? Sifting through countless records to find exactly what you need, or to operate on specific records that meet a certain criteria, can indeed be a real time-sink. Fortunately, Zoho CRM provides powerful filtering capabilities through its APIs to streamline this process.

What is criteria or filter?

In Zoho CRM APIs, criteria refer to the conditions applied to filter records when making API requests. These conditions can be simple (single condition) or complex (multiple conditions) and are specified using various comparators.

Depending on the API type and request method, the filter can be provided either:
  • As a query parameter (filters) – Used in GET requests.
  • As an input key in the request body (criteria)– Used in POST and PUT requests   

Where is "filters" used in Zoho CRM APIs?

The filters parameter is supported across multiple Zoho CRM API endpoints, including but not limited to:

Where is "criteria" used in Zoho CRM APIs?

The criteria key is supported across multiple Zoho CRM API endpoints, including but not limited to:
The filters parameter and criteria key are supported across multiple Zoho CRM API endpoints. Refer to our API help documentation for individual APIs to check if these options are available. Check the Parameters section for filters and the Input JSON section for criteria
in the API's help documentation.

Constructing a criteria or a filter

Zoho CRM APIs use JSON-based criteria/filters expressions, which consist of:
  • Field API Name – The field to filter (e.g., Email, Created_Time, Status).
  • Comparator – The operator defining how the field should be compared (equals, greater_than, etc.).
  • Value – The specific value to compare against.

Single Condition

A single condition is structured as follows:
{
  "field": {
    "api_name": "Post_Number"
  },
  "comparator": "greater_than",
  "value": 1
}

Here,
  • field specifies the API name of the field to be filtered.
  • comparator indicates the type of comparison to be made (e.g., greater_than).
  • value is the value against which the field is compared.

Multiple Conditions

When multiple conditions are required, they can be grouped using the logical operators "and" or "or". Here’s the syntax of how to structure multiple conditions:
{
  "group_operator": "or",
  "group": [
    {
      "field": {
        "api_name": "Post_Number"
      },
      "comparator": "greater_than",
      "value": 1
    },
    {
      "field": {
        "api_name": "Pre_Number"
      },
      "comparator": "greater_than",
      "value": 1
    }
  ]
}

Here,
  • group_operator can be "and" or "or". It defines how the conditions within the group array are evaluated. "and" means all conditions must be true, while "or" means at least one condition must be true.
  • group
    contains an array of condition objects, each with its own field, comparator, and value.
Following is an example for a criteria with more than two conditions:
{
  "criterion": {
    "group_operator": "and",
    "group": [
      {
        "field": {
          "api_name": "Post_Number"
        },
        "comparator": "greater_than",
        "value": 1
      },
      {
        "group_operator": "or",
        "group": [
          {
            "field": {
              "api_name": "Pre_Number"
            },
            "comparator": "greater_than",
            "value": 1
          },
          {
            "field": {
              "api_name": "Status"
            },
            "comparator": "equals",
            "value": "Active"
          }
        ]
      }
    ]
  }
}

Supported Comparators for Different Field Types

The available comparators depend on the field type. The following table outlines the supported comparators for different field types:

Field Type
Supported Comparators
Example
text/ textarea
equal, not_equal, contains, not_contains , starts_with, ends_with
{
   "comparator": "equal",
   "field": {
       "api_name": "text"
   },
   "value": "zoho"

}
email
equal, not_equal, contains, not_contains, starts_with, ends_with
{
   "comparator": "contains",
   "field": {
       "api_name": "Email"
   },
   "value": "patricia"
}
phone
equal, not_equal, contains, not_contains, starts_with, ends_with
{
   "comparator": "equal",
   "field": {
       "api_name": "Phone"
   },
   "value": "9999999999"
}
website
equal, not_equal, contains, not_contains, starts_with, ends_with
{
   "comparator": "contains",
   "field": {
       "api_name": "website"
   },
   "value": "zoho"
}
picklist
equal, not_equal, contains, not_contains, starts_with, ends_with
{
   "comparator": "equal",
   "field": {
       "api_name": "picklist"
   },
   "value": [
       "Cold Call",
        "Call"
   ]
}
multiselectpicklist
equal, not_equal, contains, not_contains, starts_with, ends_with
{
   "comparator": "equal",
   "field": {
       "api_name": "Multi_Select_Picklist"
   },
   "value": [
         "Cold Call",
        "Call"
   ]
}
date
equal, not_equal, less_than, greater_than, between, not_between, less_equal, greater_equal
Example 1:
{
   "comparator": "less_than",
   "field": {
       "api_name": "date"
   },
   "value": "01-01-2025"

}
Example 2:
{
   "comparator": "between",
   "field": {
       "api_name": "date"
   },
   "value": [
          "01-01-2025",
           "02-01-2025",
}
datetime
equal, not_equal, less_than, greater_than, between, not_between, less_equal, greater_equal
{
   "comparator": "equal",
   "field": {
       "api_name": "date"
   },
   "value": "2025-01-01T12:12:06+05:30"
}
autonumber
equal, not_equal, contains, not_contains, starts_with, ends_with
{
   "comparator": "starts_with",
   "field": {
       "api_name": "Auto_Number"
   },
   "value": "A01"
}
integer
equal, not_equal, less_than, less_equal, greater_than, greater_equal, between, not_between
{
   "comparator": "equal",
   "field": {
       "api_name": "integer"
   },
   "value": 4
}
currency
equal, not_equal, contains, not_contains, starts_with, ends_with
{
   "comparator": "equal",
   "field": {
       "api_name": "Currency"
   },
   "value": "INR"
}
double
equal, not_equal, less_than, less_equal, greater_than, greater_equal, between, not_between
{
   "comparator": "equal",
   "field": {
       "api_name": "Double"
   },
   "value": "123"
}
Boolean
equal
{
   "comparator": "equal",
   "field": {
       "api_name": "Boolean"
   },
   "value": true
}
big int
equal, not_equal, less_than, less_equal, greater_than, greater_equal, between, not_between
{
   "comparator": "equal",
   "field": {
       "api_name": "id"
   },
   "value": "1234800023843923"
}
lookup
equal, not_equal, less_than, less_equal, greater_than, greater_equal, between, not_between
{
   "comparator": "equal",
   "field": {
       "api_name": "Lookup.name"
   },
   "value": "Name1"
}
ownerlookup/userlookup
in, not_in 
{
   "comparator": "equal",
   "field": {
       "api_name": "Modified_By",
       "id": "400029000000000479"
   },
   "value": [
       {
           "id": "400029000003984001",
           "name": "User1"
       },
       {
           "id": 400029000003984002,
           "name": "User2"
       }
   ]
}
formula
Comparator will depend on the return type
-



Notes
Note: 
  • Use quotes for strings and picklists; do not use quotes for numbers and boolean values.
  • While Zoho CRM’s filtering capabilities are extensive, certain field types — including subforms, multi-select lookup fields, multi-user lookup fields, and multi-module lookup fields — are not supported in filters and criteria. The above table lists all the supported field types. 

Filtering in COQL Queries

COQL (CRM Object Query Language) provides a structured way to retrieve records from Zoho CRM using SQL-like queries. Unlike the standard API filters discussed above, COQL uses the WHERE clause to define conditions.

Here is a sample COQL query:

{
  "select_query": "SELECT Full_Name, Email FROM Leads WHERE Lead_Status = 'Qualified'"
}

Here, Lead_Status = 'Qualified' acts as the filtering criteria.

{
  "select_query": "SELECT Full_Name, Email FROM Leads WHERE (Lead_Status = 'Qualified' AND City = 'New York') OR (Industry = 'Software')"
}

The AND and OR operators allow for multiple conditions in the WHERE clause. We have covered COQL API, and all the supported field types and operators in detail in our Kaizen posts. Kindly refer to them for more details.

Criteria in Search API

In Search API, filtering records is done using the criteria (string) input key in the request body. Unlike filters in GET requests or criteria in other APIs, criteria here is a text-based filter expression that follows a specific syntax.

(({api_name}:{operator}:{value})and/or({api_name}:{operator}:{value}))
  • You can combine up to 10 conditions using and or or.
  • Only the equals operator is supported for encrypted fields.
  • When using "equals" in Search API, it behaves like "contains", meaning it fetches records that include the specified value, not just exact matches.
  • If you use parentheses (), commas, or backslashes \ in values, you must escape them properly and encode the value before making the request.
Field Type
Supported Operators
Date, DateTime
equals, not_equal, greater_equal, greater_than, less_equal, less_than, between, in
Integer, Currency, Decimal
equals, not_equal, greater_equal, greater_than, less_equal, less_than, between, in
Boolean
equals, not_equal
textarea
equals, not_equal, starts_with
Lookup (user/owner)
equals, not_equal, in
Picklist, Autonumber
equals, not_equal, in
Text, Email, Phone, Website 
equals, not_equal, starts_with, in
multiselectpicklist
equals, not_equal, in, starts_with.
bigint
equals, not_equal, greater_than, greater_equal, less_than, less_equal, between, in
percent
equals, not_equal, greater_than, greater_equal, less_than, less_equal, between, in
formula
The supported operators of the formula datatype will depend on the return type of the formula


Have questions or use cases to share? Feel free to share them in the comments below or reach out to our support team directly at support@zohocrm.com.

Thank you for joining us this week. Stay tuned for more insights in our upcoming Kaizen posts! Happy Coding!!



    • Sticky Posts

    • Kaizen #197: Frequently Asked Questions on GraphQL APIs

      🎊 Nearing 200th Kaizen Post – We want to hear from you! 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 #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.
    • Celebrating 200 posts of Kaizen! Share your ideas for the milestone post

      Hello Developers, We launched the Kaizen series in 2019 to share helpful content to support your Zoho CRM development journey. Staying true to its spirit—Kaizen Series: Continuous Improvement for Developer Experience—we've shared everything from FAQs
    • Kaizen #193: Creating different fields in Zoho CRM through API

      🎊 Nearing 200th Kaizen Post – We want to hear from you! 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.
    • Client Script | Update - Introducing Commands in Client Script!

      Have you ever wished you could trigger Client Script from contexts other than just the supported pages and events? Have you ever wanted to leverage the advantage of Client Script at your finger tip? Discover the power of Client Script - Commands! Commands
    • Recent Topics

    • To Zoho customers and partners: how do you use Linked Workspaces?

      Hello, I'm exploring how we can set up and use Linked Workspaces and would like to hear from customers and partners about your use cases and experience with them. I have a Zoho ticket open, because my workspace creation fails. In the meantime, how is
    • How to access email templates using Desk API?

      Trying to send an email to the customer associated to the ticket for an after hours notification and can't find the API endpoint to grab the email template. Found an example stating it should be: "https://desk.zoho.com/api/v1/emailtemplates/" + templateID;
    • How to render either thumbnail_url or preview_url or preview_data_url

      I get 401 Unauthorised when using these urls in the <img> tag src attribute. Guide me on how to use them!
    • Update Portal User Name using Deluge?

      Hey everyone. I have a basic intake form that gathers some general information. Our team then has a consultation with the person. If the person wants to move forward, the team pushes a CRM button that adds the user to a creator portal. That process is
    • Zoho Bookings No Sync with Outlook

      Zoho Bookings appointments are showing on my Outlook Calendar but Outlook events are not showing on Zoho Bookings. How do I fix this?
    • Unable to retrieve Contact_Name field contents using Web API in javascript function

      Hello, I've added a field in the Purchase Order form to select and associate a Sales Order (Orden_de_venta, lookup field). I've also created a client script to complete some fields from the Sales Order (and the Quote), when the user specifies the related
    • Updating Woocommerce Variation Products Prices Via Zoho CRM

      I can update product prices with this flow: But I can't update variant products. I got a code from Zoho for this, but I couldn't get it to work. It needs to find the product in the CRM from the SKU field and update the variation with the price there.
    • Emails Disappearing From Inbox

      I am experiencing the unnerving problem of having some of the messages in my inbox just disappear.  It seems to happen to messages that have been in there for longer than a certain amount of time (not sure how long exactly). They are usually messages that I have flagged and know I need to act on, but have not gotten around to doing so yet.  I leave them in my inbox so I will see them and be reminded that I still need to do something about them, but at least twice now I have opened my inbox and found
    • Power of Automation :: Automatic removal of project users once the project status is changed.

      A custom function is a software code that can be used to automate a process and this allows you to automate a notification, call a webhook, or perform logic immediately after a workflow rule is triggered. This feature helps to automate complex tasks and
    • Customizing Form Questions per Recipient Group in Zoho Campaigns/Forms

      Hello everyone, I would like to ask if it’s possible in Zoho Campaigns or Zoho Forms to send out a campaign where the form questions can be customized based on the group of recipients. Use case example: I have prepared 20 questionnaire questions. For
    • Automatic category assignment

      Hi, I’d like to ask if there is a way to automatically assign an expense category based on the recognized Merchant. What would be the simplest way to set up automatic category assignment? Alternatively, is there an option to first choose the category
    • Zoho Books - France

      L’équipe de Zoho France reçoit régulièrement des questions sur la conformité de ses applications de finances (Zoho Books/ Zoho Invoice) pour le marché français. Voici quelques points pour clarifier la question : Zoho Books est un logiciel de comptabilité
    • Every time an event is updated, all participants receive an update email. How can I deactivate this?

      Every time an event is updated in Zoho CRM (e.g. change description, link to Lead) every participant of this meeting gets an update email. Another customer noticed this problem years ago in the Japanese community: https://help.zoho.com/portal/ja/community/topic/any-time-an-event-is-updated-on-zohocrm-calendar-it-sends-multiple-invites-to-the-participants-how-do-i-stop-that-from-happening
    • Having Trouble Opening The Candidate Portal

      Recently am having trouble opening the Candidate Portal. It keeps loading but cannot display any widgets. Tried Safari, Chrome and Edge. Non of them work. Please solve the problem ASAP.
    • Forms - Notification When Response Submitted

      How do I set it up to generate an email notification when a response (class request) is submitted?
    • Notes Issues

      Been having issues with Notes in the CRM. Yesterday it wasn't showing the notes, but it got resolved after a few minutes., Now I have been having a hard time saving notes the whole day. Notes can't be saved by the save button. it's grayed out or not grayed
    • How to disable user entry on Answer Bot in Zobot

      Hi, I have an Answer Bot in my Zobot, here is the configuration: I only want the user to choose 1 of the 4 the options I have provided: When no answer found, user chooses 'I'll rephrase the question' or 'Ask a different question When answer is found,
    • More admin control over user profiles

      It's important for our company, and I'm sure many others, to keep our users inline with our branding and professional appearance. It would be useful for administrators to have more control over profile aspects such as: Profile image User names Email signatures
    • Please Make Zoho CRM Cadences Flexible: Allow Inserting and Reordering Follow-Up Steps

      Sales processes are not static. We test, learn, and adapt as customers respond differently than expected. Right now, Zoho Cadences do not support inserting a new step between existing follow-ups or changing the type of an existing primary step. If I realize
    • Changing the Default Search Criteria for Finding Duplicates

      Hey everyone, is it possible to adjust the default search criteria for finding and merging duplicate records? Right now, CRM uses some (in my opinion nonsensical) fields as search criteria for duplicate records which do nothing except dilute the results.
    • Clear Tag & Linking Between Quotes and Sales Orders

      Hi Zoho Team, In Zoho Books, when a quote is converted into a sales order, it would be extremely useful to have: A clear tag/indicator on the quote showing that it has been converted into a sales order. A direct link in the sales order back to the originating
    • Zoho Books Sandbox environment

      Hello. Is there a free sandbox environment for the developers using Zoho Books API? I am working on the Zoho Books add-on and currently not ready to buy a premium service - maybe later when my add-on will start to bring money. Right now I just need a
    • Add Direct Ticket Link to Zoho Help Center Portal in Email Replies

      Hi Zoho Support Team, We hope you're doing well. We’d like to request a small but valuable improvement to enhance the usability of the Zoho Help Center portal (https://help.zoho.com/portal/en/myarea). Currently, when someone from Zoho replies to a support
    • [Webinar] Deluge Learning Series - AI-Powered Automation using Zoho Deluge and Gemini

      We’re excited to invite you to an exclusive 1-hour webinar where we’ll demonstrate how to bring the power of Google’s Gemini AI into your Zoho ecosystem using Deluge scripting. Whether you're looking to automate data extraction from PDFs or dynamically
    • Connecting Zoho Inventory to ShipStation

      we are looking for someone to help connect via API shipStation with Zoho inventory. Any ideas? Thanks. Uri
    • Subform edits don't appear in parent record timeline?

      Is it possible to have subform edits (like add row/delete row) appear in the Timeline for parent records? A user can edit a record, only edit the subform, and it doesn't appear in the timeline. Is there a workaround or way that we can show when a user
    • 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
    • Im Stuck in an EDIT ONLY WITH WIZARD issue

      So I found Wizards to be a really helpful tool in minimizing the exposure of redundant, superfluous fields to staff that would never otherwise have to edit those fields. My issue is, that when the record (in this case a lead) is created with a wizard,
    • Account upgrade

      Good evening, I upgraded my account and paid for it. From standard to professional. Unfortunately after the paiment my account was not upgraded. Please your advise. Best Regards Erik van Staverden
    • How to set ALL default dates of my organization to DD-MM-YYYY format?

      All replies to this question comes from a time where the UI was different. It's extremely frustrating not being able to find how to do this simple setting change. I want everything and everyone in my organizations to have DD-MM-YYYY date format by default.
    • How can I sync from Zoho Projects into an existing Zoho Sprints project?

      Hi I have managed to integrate Zoho Projects with Zoho Sprints and I can see that the integration works as a project was created in Zoho Sprints. But, what I would like to do is to sync into an existing Zoho Sprints project. Is there a way to make that
    • Can we generate APK and IOS app?

      Dears, I want to know the availability to develop the app on zoho and after that .. generate the APK or IOS app  and after that I added them to play store or IOS store.. Is it possible to do this .. I want not to use zoho app or let my customers use it. thanks 
    • Zoho Subform Workflows onAdd of Row

      Suppose I have a form with attached workflows onLoad. If I use the form as a subform, will it inherit the workflows or do I need to create new ones onAdd of row?
    • Session Expired

      I constantly get "Session Expired" and need to relogin or close and open the application again. This gets really frustrating during the day. Is this something that can be solved? This really makes me want to leave the app as it is no go to need to reopen
    • Super Admin removal

      I brought a sub, and I gave the Super admin rights to a person who is no longer with us, so I need to change, and I need to make myself the Super admin
    • Better Notes Commenting

      Hi, I'd like to suggest better collaboration tools for NOTES. The current notes section for Accounts, Contacts and Deals is not ideally suitable for any degree of communication or collaboration. When responding to a note, there is no ability to leave
    • Exporting Templates

      I have just spent 2 hours creating a project template for a Netsuite configuration, and want to share it with other Zoho Projects users - who have a different account. Is there any way to do this?
    • Power of Automation:: Streamline Associated Teams based on the Task Owner update.

      Hello Everyone, A Custom function is a user-written set of code to achieve a specific requirement. Set the required conditions needed as when to trigger using the Workflow rules (be it Tasks / Project) and associate the custom function to it. Requirement:
    • No Response from Zoho Support in 8 Days - Typical?

      I have a couple of issues I'm trying to work through. Initially, I was getting support from support@zohofsm.com, but I have not received a response in 8 days (11 on another question). Is this typical? Can I pay for support? For context, I am not spamming
    • Add QUOTE OWNER profile image to a Quote Template

      I can add their email address.. phone number, DOB. I need to add a users profile picture so when they assign a template to a quote they own it adds their picture to the cover page. I've tried hacking a solution together but there has to be an easier way.
    • Next Page