Filter Response
In Zoho CRM GraphQL queries, the result set of _Records type can be filtered according to your needs using where clause. Each {module}__connection supports {module}__Filter type argument. For example, in the _Records schema, Products module has Products_Filter. In the Products_Filter possible fields and operator types are defined.
type Products__Filter
Copied
Show full
Show less
Field Operators
Field operators refer to the operators that can be applied to fields within a query. Fields operators when combined with each field and specified value form each predicate in the where clause of the query. The field operators that are available in Zoho CRM GraphQL are :
Operator | Description |
---|---|
equals | The expression is true if the field value is equal to the specified value. |
not_equals | The expression is true if the field value is not equal to the specified value. |
greater_than | The expression is true if the field value is greater than the specified value. |
greater_equal | The expression is true if the field value is greater than or equal to the specified value. |
less_than | The expression is true if the field value is less than the specified value. |
less_equal | The expression is true if the field value is less than or equal to the specified value. |
like | The expression is true if the string field value matches the pattern specified. |
not_like | The expression is true if the string field value does not match the pattern specified. |
in | The expression is true if the field value is present in a list specified. |
not_in | The expression is true if the field value is not present in a list specified. |
Each _Records Type has a corresponding Filter where the filtering capacity of each field is defined. For example in the Products_Filter shown above the field Qty_in_Demand is _FloatOperators. The operators supported for Float are as below
Type _FloatOperators
Copied
Field types and Operators
Field Type | Field Operator | Allowed Operators |
---|---|---|
Int | _IntOperators | equals,not_equals,in,not_in,greater_than,greater_equal,less_equal,less_than |
Encrypted Int | _EncryptedIntOperators | equals,not_equals |
Float | _FloatOperators | equals,not_equals,in,not_in,greater_than,greater_equal,less_equal,less_than |
encrypted float | _EncryptedFloatOperators | equals,not_equals |
long | _LongOperators | equals,not_equals,in,not_in,greater_than,greater_equal,less_equal,less_than |
encrypted long | _EncryptedLongOperators | equals,not_equals |
string | _StringOperators | equals,not_equals,in,not_in,like,not_like |
date long | _DateLongOperators | equals,not_equals,in,not_in,greater_than,greater_equal,less_equal,less_than |
boolean | _BooleanOperators | equals |
Each Zoho CRM Data Type is mapped to a GraphQL field type as shown in the table below:
GraphQL Field Types | Zoho CRM Data Types |
---|---|
String Field Types | Single Line |
Multi Line | |
String | |
Picklist | |
URL | |
Date | |
DateTime | |
Integer Field Types | Number |
Double Field Types | Decimal |
Currency | |
Percent | |
Long Field Types | Long Integer |
Boolean Field Types | Checkbox |
Like Operator
The like operator behaves similarly to how it behaves in COQL. The % wildcard can be used with the like operator to achieve functionalities similar to the contains, starts_with, and ends_with operators. For instance, consider that you are filtering based on Email field. '%john, queries for email field values ending with 'john', 'john%' queries for values starting with 'john', and '%john%' translates to contains john. If you query for 'john' like works as equals. Please note that for the Not Like operator, it only works if you give '%' at both ends (not contains). Using '%' only at the beginning (not starting with) or at the end (not ending with) doesn't work and will throw INVALID_QUERY error. Not using wildcard will make not like work like not equal.
_StringOperators
Copied
Show full
Show less
_BooleanOperators
Copied
_DateLongOperators
Copied
_EncryptedFloatOperators
Copied
_EncryptedIntOperators
Copied
_EncryptedLongOperators
Copied
_IntOperators
Copied
_FloatOperators
Copied
_LongOperators
Copied
Boolean Operators
Boolean Operators combines the several predicates in your where clause. Supported Boolean Operator in Zoho CRM GraphQL are AND, OR. You can use the OR function to combine filters, and use the AND function to overlap filters.
AND operator
Syntax
where: { and: [ {filter1}, {filter2} ] }
OR operator
Syntax
where: { or: [filter1, filter2, filter3] }
Query contacts where last name starts with Di and mobile contains the digit 5 or phone number equals 555-555-5555
Copied
Show full
Show less
Response
Copied
Show full
Show less
More examples
Query Leads by sending list of IDs
Copied
Query lead if its id present in list of ids
Copied
Query Leads where full name is like given string
Copied
Query Leads where full name is not null
Copied
Query Leads where number of employees are less than 10
Copied