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!!



    • Recent Topics

    • Increase size of description editor when creating new ticket

      Please can you consider making the description editor in the create new ticket form a resizeable area as by default, it is very small and there appears to be no way to increase the size of it.
    • CRM For Everyone - Bring Back Settings Tile View

      I've been using CRM for Everyone since it was in early access and I just can't stand the single list settings menu down the left-hand side. It takes so much longer to find the setting I need. Please give users the option to make the old sytle tile view
    • Add "Ask Zia" Functionality for Report Creation in Zoho Desk

      Hi, How are you? We’ve noticed that Zoho CRM offers a very useful feature called "Ask Zia", which allows users to enter natural language prompts to generate reports quickly and easily using Zia's AI capabilities. Currently, Zoho Desk does not support
    • Compensation | Salary Packages - Hourly Wage Needed

      The US Bureau of Labor Statistics says 55.7% of all workers in the US are paid by the hour. I don't know how that compares to the rest of the world, but I would think that this alone would justify the need for having an hourly-based salary package option.
    • Zoho FSM API to search Zoho FSM Assets by Asset_Number?

      How can I search or otherwise retrieve an Asset from the Assets module in Zoho FSM using the Asset_Number? The API docs seem to say that the only field that can be searched is the Asset Name. Is this true? https://www.zoho.com/fsm/developer/help/api/search-records.html
    • Proposal for Creating a Unique "Address" Entity in Zoho FSM

      The "Address" entity is one of the most critical components for a service-oriented company. While homeowners may change and servicing companies may vary, the address itself remains constant. This constancy is essential for subsequent services, as it provides
    • I can't use zoho in my personal computer

      Facing error on monitor Oops! An error occurred
    • My Zoho Account Not Working, Suddenly its stoped

      Hello Team, our company email account is not working, we are not receiving email. Website: www.urgentdubaivisaonline.com Email: social@urgentdubaivisaonline.com
    • MX verification

      Dear All I face a difficulties to verify MX records in my domain alfagrouptrading.sk it is since two days. records are correct and I am waiting for 48 hour I send email shown in the error message with no reply.in addition, it supposed to be propagated
    • I'm not receiving emails.

      Hello. I'm having an issue in which I am able to send emails using my zoho mail, but I seem to be unable to receive them. please help.
    • Change zoho email address

      I am displeased with the email address I created. It's too long.
    • Departments Limit

      There is a limit of departments that i can have on zoho desk?
    • CRM for Everyone - More Actions Option to Create Record

      Please consider the option create a new record for the relevant record from the More Actions menu. I know there is an "Add New" icon further down the menu to create a record for any module, but this just seems more intuitive and could reduce the need
    • Unified WhatsApp Number Management in Zoho Desk and SalesIQ

      Dear Zoho Desk Support Team, We are currently utilizing both Zoho Desk and Zoho SalesIQ for our customer support operations. While both platforms offer WhatsApp integration, we are facing challenges due to the requirement of separate WhatsApp numbers
    • Mass Update of Lookup Fields not possible

      Hello List I've created a custom field for Leads and Contacts 'Current Campaign'. This is very Handy as I can filter leads and then related them to a campaign. Everything ready, but then I realized that mass update doesn't work for lookup fields... a
    • Time Limited Coupon or Expiring Link in Workflows

      I would like to see a feature where I can include a time limited link in Workflow Campaigns. For example: I could link to a sales page with a discount and set the link to expire after 24h. The link would be generated by Campaigns for each campaign sent
    • How to create a form using both contact and account fields?

      I am sending a prefilled form from CRM with fields mapped, to update records in CRM. If I link the CRM field to the Contacts module, the Account Name field doesn't come up as an option in CRM. If I added it under Related Fields, my understanding it would
    • Boost your Zoho Desk's performance by archiving tickets!

      The longer your help desk operations are, the more likely it is to accumulate tickets that are no longer relevant. For example, ticket records from a year ago are typically less relevant than currently open tickets. Such old tickets may eventually lead
    • Are Zoho Help Center Email Notifications Customisable?

      Hi, I would like to find out if the Zoho Help Center email notifications can be customised to add our own styling and branding? These are the notifications that get sent when a client adds a new topic, adds a comment, signs up to the help center, etc?
    • Wizard Form

      I would like the option to create a wizard that works when you create a record and contacts that are already in the CRM captured with a web 2 lead form (field data inserted in to the wizard).  Having the option to create up to 3/4 segments per screen
    • Two-Way Sync Zoho CRM Custom Module with Zoho FSM Company Addresses

      Business fact: Many companies don't just have one location. They have multiple locations (some have many), with addresses we need to know for service, deliveries, etc. We have created a custom "Sites" module in Zoho CRM to store an Account/Company's addresses
    • Sharing and Converting Custom Reports Across Departments in Zoho Desk

      Hello, We initially started using Zoho Desk with a single department (Department "A"), which included multiple teams. Nearly a year later, we identified several limitations that led us to create three additional departments ("B", "C", and "D") with replicated
    • Dynamic Dashboard for CRM Flyout/Widget

      Hello, Apologies if this has been answered before—it's possible I'm just not searching the community with the right terms. I'm trying to create a dashboard in Zoho Analytics that pulls together reports from several datasets (e.g., CRM Deals, Books Invoices,
    • Mapping a new Ticket in Zoho Desk to an Account or Deal in Zoho CRM manually

      Is there any way for me to map an existing ticket in Zoho desk to an account or Deal within Zoho CRM? Sometimes people use different email to put in a ticket than the one that we have in the CRM, but it's still the same person. We would like to be able
    • Does Thrive work with Zoho Billing (Subscriptions)?

      I would like to use Thrive with Zoho Billing Subscriptions but don't see a way to do so. Can someone point me in the right direction? Thank you
    • Zoho Sprints mobile app(Android and iOS) v2.0

      Hello everyone! We’re thrilled to announce that Zoho Sprints Mobile app2.0 is now live. With the newest version of the Zoho Sprints mobile app, we hope to provide a fresh, faster, and intuitive experience for managing your sprints on the go! Whether you're
    • Subform dynamic fields on Edit, Load of Main form.

      Main Form: Time_Entry Sub Form (separate form): Time_Entries Time_Entries.Time_Entry_No is lookup to - Time_Entry.Time_Sheet_ID (auto number). I would like to disable some of the subform fields upon load (when edited) of the Time_Entry main form. What
    • View Answer Bot conversations?

      We are trialing Zia and are experimenting with Answer Bot on our knowledge base. So far so good! Management asks me if it is possible to view Answer Bot conversations, the purpose being to look over its shoulder and confirm that it is working as des
    • Delivery note from order or from offer

      Hello, in our company and in a lot of companies in Italy, the standard workflow is (in order): 1) Offer 2) Customer order 3) Delivery note. We can have also more delivery notes in one month. 4) Invoice at the end of the month from delivery note (so only
    • Sesiones 1:1 en Zoholics España 2025

      Una de las experiencias más valoradas por los asistentes a Zoholics son las sesiones 1:1 con nuestros expertos técnicos. Este 2025, las traemos de vuelta con aún más fuerza: cada entrada a Zoholics España 2025 incluye una sesión individual gratuita de
    • VOIP integration

      I emailed this question to rishi but never got a response. I notice when I mouse over phone number it has a link to launch into SKYPE. We dont use SKYPE we use Xlite SIP client. Is it possible to change that link to launch our client API? If so how? If not any plans to make that VOIP integration customizable?
    • "The email sending domain must have an active and functional website so that we can proceed with the review."

      I've requested the approval of my account, and got the following response back: "The email sending domain must have an active and functional website so that we can proceed with the review." This is absolutely false. The website I have provided has been
    • Gestion de suivi des expéditions

      Le suivi des expéditions est un élément indispensable à une gestion réussie de la chaîne d'approvisionnement. Aussi bien le fournisseur que le client peuvent bénéficier de la transparence et de la responsabilité apportées par le système ; ce dernier fournit
    • 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?
    • Last activity time is acting like last modified time

      When i edit the description or any field in the potential, account, contact and lead, the Last Activity Time is being updated like the Modified Time. This is messing all workflows and reports and we are unable to track real last time of activities like mentioned in this KB article http://crmkbase.zoho.com/what-is-the-difference-between-record-modified-time-and-record-last-activity-time
    • Integrate QuickBooks with Bigin and streamline your sales and accounting!

      If your business relies on Bigin for customer management and QuickBooks for accounting and invoicing, this new integration is here to make your operations more efficient. By connecting these two platforms, you can now manage your CRM and financial processes
    • Upload File via email

      Will there be an option to upload a file via email?
    • Footer: Zoho make a big downgrad with new footer option

      Every post about the new footer function is negative and all say: its a big downgrade. The idea behind this new function was: Make it more simple. Great, now its faster and more simple to add an footer. But nobody from zoho team think about the more bigger
    • Office 365 is marking us as "bulk"

      All of a sudden (like a couple of days ago) all of our customers who are on Office 365 are getting our mails in their junk email. This is not the case with Gmail or other random mail servers, nor between us. We got a 10/10 score on mail-tester.com. Also,
    • How to use milestones and task lists effectively

      I am trying to use Zoho Projects for my development process. My goal is to manage project status and provide reports to the customer. I am developing an app (2 apps to be precise: 1 for Android and 1 for iOS) I originally thought my milestones would be: 1. Analysis and Design 2, Android Development 3. iOS Development 4. Web Console Development 5. Quality Control 6. Deployment But then I needed a tasklist before I created a task so it was sort of duplicated with tasklists being a superfluos duplicate
    • Next Page