The query language ressembles the SQL language and allows powerful queries. A typical example would be:
...
General features | |||||
---|---|---|---|---|---|
= == | Compare field with a value. You can use both "=" and "==". These and other operators can be used with most field types.
Use double quotes with strings. Inside a string literal, a double quote is written as two consecutive double quotes:
| ||||
>, < >=, <= | To compare numeric field values and dates.
| ||||
!= <> | Not equal operators. Both have the same function. | ||||
AND && | Boolean "and" to combine conditions.
| ||||
OR || |
| ||||
!= | Not equal.
| ||||
( ) | Brackets can be used to combine multiple conditions:
| ||||
! NOT | Negation:
| ||||
x ? y : z | Evaluates y if x is true, evaluates z if x is false.
| ||||
null | Literal to evaluate if a field is null or not:
| ||||
Numbers | |||||
+ - * / | Numeric operators.
| ||||
Decimals | Decimal fields use the optional '.' (dot) decimal point:
| ||||
Strings | |||||
.StartsWith .EndsWith .Contains | Various operators to search string fields by prefix, suffix or infix. Use NOT to negate.
| ||||
.Length | To query by string length:
| ||||
Dates | You can use the DateTime object to compare dates. | ||||
To compare a date:
Or with hours, minutes and seconds:
|
...
It takes away most of the complexity of properly formatting and evaluating different field types, including dates, multi-select custom fields, labels and advanced string searches.
...
.
Examples:
Code Block |
---|
{myfield}.Matches("hello", "prefix") {myfield}.Matches("2018-1-1", ">=") {myfield}.Matches(10, ">=", 100, "<") {myfield}.Matches("world") AND {mydate}.Matches("2018-1-1", ">=", "2018-1-2", "<") ... |
...
Basic | Exact numeric match:
Range match:
The operators can be any of: >, <, >=, <=, =, !=
| Null values | ||||
Find Any of | This construct matches if the field matches any one of the pipe separated values:
| |||||
Null values | Find null values with fields that are nullable:
|
...
Decimals filtering
Basic | Like with numeric fields, you can do different comparisonsSummary | You can use all the features also available with number filters. Please always use the "." (dot) character for the decimal point. The decimal point is optional. Examples:
|
Date filtering
Basic | Like with numeric fields, you can do different comparisons:
Important:
| ||||
Date formats | Formats that are supported are:
Note: Partial date/times are automatically expanded. Example: "2018" is converted to 2018-01-01 00:00 | ||||
Null values | Find null values with fields that are nullable:
| ||||
Filter day or month | All deadlines on a day (UTC):
All deadlines in a month (UTC):
|
Boolean filtering
Basic | Valid examples:
Permitted operators are: "=" and "!=".
|
Custom field multi select picklists
Multi-select pick list custom fields store selected values in a very specific format:
- "|Austria|France|Germany|"
Selected options are pipe delimited.
Find all options | Write like thisDate offsets | Sometimes it is easier to filter by a date offset. For example: Find jobs with a deadline of tomorrow. This can be expressed with "1d". More examples:
You can thus use one or more combinations of:
Deadline within +/- 6 hours:
All objects created since 1 year and 6 months:
|
Date offset filtering
Date offsets | Sometimes it is easier to filter by a date offset. For example: Find jobs with a deadline of tomorrow. This can be expressed with "1d". More examples:
Deadline within +/- 6 hours:
All objects created since 1 year and 6 months:
| ||||
Units | You can thus use one or more combinations of:
You can prefix offset with "-" for dates into the past: -1y stands for one year ago. You can prefix with optional "+" for dates into the future: +1y (or 1y) stands for one year from now. |
Boolean filtering
Basic | Valid examples:
Permitted operators are: "=" and "!=".
|
Custom field multi select picklists
Multi-select pick list custom fields store selected values in a very specific format:
- "|Austria|France|Germany|"
Selected options are pipe delimited.
Find all options | Write like this:
| ||
Find any option | Write like this:
|
Comments: Whenever the field is a multi-select picklist, the system will automatically adjust the query. For the example above the query wil be:
Code Block |
---|
{cffield}.Matches("o1|o2|o3", "anyof")
== translated to ==>
{cffield}.Contains("|o1|") OR {cffield}.Contains("|o2|") OR {cffield}.Contains("|o3|") |
Labels count field
The labels count field returns the total labels assigned to an object such as a job or project.
It contains 2 properties:
- cnt: Total assigned labels.
- xp: Total explicitly set labels. This excludes labels that are configured to automatically show up on ALL objects with a default value.
The available query options are:
Filter for xp > 0 | This filter returns all objects that have at least one label that was explicitly assigned by a user.
| ||
Find for xp = 0 | This filter returns all objects with no label assigned by a user.
|
Label field
The available query options are:
Filter label options | Write like this:
You can also use the optional operator:
If a label is not shown by default, it can also have the "null" option:
| |||||||
Exclude label options | Write like this:
If a label is not shown by default, it can also have the "null" option:
| Find any option | Write like this
| |||||
Any label option | To filter for data where the label has any of the options:
|
...
| |||
Comments | When specifying a single value, the quotes are optional.
|
...
|
...
|
...
|
...
|
...
|
Query tree
When running queries the results may include a JSON representation of your query.
...