The entity type of the filter determines which fields are available in conditions. The field type determines which operators are available. Here's a reference for the compatible fields and operators along with some usage examples.
Field | Type |
---|---|
id | Number |
name | String |
jobTitle | String |
String | |
phone | String |
city | String |
zip | String |
state | String |
country | String |
type | String |
tag | Number, string |
owner | Number |
team | Number |
hasEmailAddress | Boolean |
hasPhoneNumber | Boolean |
hasAddress | Boolean |
hasPeople | Boolean |
hasTags | Boolean |
addedOn | Date |
updatedOn | Date |
lastContactedOn | Date |
custom:{fieldId} | Boolean, date, number, string |
org.custom:{fieldId} | Boolean, date, number, string |
org.name | String |
org.tag | Number, string |
Field | Type |
---|---|
id | Number |
name | String |
status | String |
pipeline | Number, string |
milestone | String |
probability | Number |
lostReason | String |
currency | String |
expectedValue | String |
tag | Number, string |
owner | Number |
team | Number |
isOpen | Boolean |
isStale | Boolean |
isOwnedByMe | Boolean |
hasTags | Boolean |
addedOn | Date |
updatedOn | Date |
closedOn | Date |
expectedCloseOn | Date |
custom:{fieldId} | Boolean, date, number, string |
Field | Type |
---|---|
id | Number |
name | String |
status | String |
board | Number, string |
stage | Number, string |
tag | Number, string |
owner | Number |
team | Number |
isOpen | Boolean |
isOwnedByMe | Boolean |
hasTags | Boolean |
addedOn | Date |
updatedOn | Date |
closedOn | Date |
expectedCloseOn | Date |
custom:{fieldId} | Boolean, date, number, string |
Operator | Supported Field Types | Type of Value |
---|---|---|
is | Boolean, date, number, string | As field type |
is not | Boolean, date, number, string | As field type |
starts with | String | String |
ends with | String | String |
contains | String | String |
is greater than | Number | Number |
is less than | Number | Number |
is after | Date | Date |
is before | Date | Date |
is older than | Date | Number (of days) |
is within last | Date | Number (of days) |
is within next | Date | Number (of days) |
To find all parties tagged with example
:
{
"filter": {
"conditions": [
{
"field": "tag",
"operator": "is",
"value": "example"
}
]
}
}
Tags can also be referenced by ID. This is useful because it ensures that conditions will continue to work even if the tag is renamed:
{
"filter": {
"conditions": [
{
"field": "tag",
"operator": "is",
"value": 123
}
]
}
}
To find all people in the United States that were added in 2018:
{
"filter": {
"conditions": [
{
"field": "type",
"operator": "is",
"value": "person"
},
{
"field": "country",
"operator": "is",
"value": "US"
},
{
"field": "addedOn",
"operator": "is after",
"value": "2017-12-31"
},
{
"field": "addedOn",
"operator": "is before",
"value": "2019-01-01"
}
]
}
}
To find opportunities owned by user 123
or user 456
:
{
"filter": {
"conditions": [
{
"orGroup": [
{
"field": "owner",
"operator": "is",
"value": 123
},
{
"field": "owner",
"operator": "is",
"value": 456
}
]
}
]
}
}
To find all people sorted by last contact date:
{
"filter": {
"conditions": [
{
"field": "type",
"operator": "is",
"value": "person"
}
],
"orderBy": [
{
"field": "lastContactedOn",
"direction": "ascending"
}
]
}
}
When filtering by custom field, it should be referenced by its ID.
To find all parties with a value of true
in a custom field with an ID of 1
:
{
"filter": {
"conditions": [
{
"field": "custom:1",
"operator": "is",
"value": true
}
]
}
}