Filters in the body
The filter block in the body is used for filtering the result of a read, lookup or execute call. The filter can contain multiple lines, where each line functions as an AND filter.
The following operators are available:
Operator | Description |
---|
exists | value = true: returns all records where the given field name has a value. value = false: returns all records where the given field name does not have a value. |
contains | returns all records where the given field contains the given value. |
eq | returns all records that match exactly. |
ne | returns all records that do not match. |
lt | returns all records with a lesser value than the given value. |
le | returns all records with a lesser value than or equal to the given value. |
gt | returns all records with a greater value than the given value. |
ge | returns all records with a greater than or equal to the given value. |
in | returns all records where the given field matches any item in a given list of values exactly. |
ni | returns all records where the given field does not match any item in a given list of values exactly. |
Note: Use double quotes for strings and no quotes for numbers, true and false.
Example (generic)
{
"filter" : {
"[Property1]": {
"exists": "<boolean>",
"contains": "<value>",
"eq": "<value>",
"ne": "<value>",
"lt": "<value>",
"le": "<value>",
"gt": "<value>",
"ge": "<value>",
"in": "<value>",
"ni": "<value>"
},
"[Property2]": {
"exists": "<boolean>",
"contains": "<value>",
"eq": "<value>",
"ne": "<value>",
"lt": "<value>",
"le": "<value>",
"gt": "<value>",
"ge": "<value>",
"in": "<value>",
"ni": "<value>"
}
},
"values" : {},
"answers" : {},
"arguments" : {}
}
Example for Person BO
Looking for a person named ‘John’ who is working for us.
{
"filter": {
"FirstName": {
"eq": "John"
},
"EndDate": {
"exists": false
}
}
}
Example for UrsReservationMeetingRoom
Looking for low priority reservations on a specific day for a specific property.
{
"filter": {
"BeginDateTime": {
"gt": {
"date": "2022-12-22",
"time": "00:00:00"
}
},
"EndDateTime": {
"lt": {
"date": "2022-12-23",
"time": "00:00:00"
}
},
"PropertyRef": {
"eq": 8
},
"HighPriority": {
"eq": false
}
}
}