Filter object
When you filter records, for example, when reading records via SelectQuery DataService class or EntitySchemaQuery class, or when defining a segment entry filter, Creatio represents the filtering criteria as a JSON format object. Learn more: Filters class.
Filter object
The hierarchical structure of a filter is conveniently presented as a JSON format object.
{
"filterType": [Filter type],
"comparisonType": [Comparison type],
"logicalOperation": [Logical operation],
"isEnabled": [Activation flag],
"leftExpression": [Expression to be checked],
"rightExpression": [Filtration expression],
"rightLessExpression": [Initial filtration range expression],
"rightGreaterExpression": [Final filtration range expression],
"items": [Filter group collection],
"segmentFilterOptions": [Segment filter parameters]
}
integer filterType
Filter type. Set to "7" for a segment membership filter. Learn more: Filters class.
integer comparisonType
Comparison operation type. The available values are listed in the FilterComparisonType enumeration. Learn more: Filters class.
integer logicalOperation
Logical operation used to join child filters inside a FilterGroup. The available values are listed in the LogicalOperationStrict enumeration. Learn more: Filters class.
boolean isEnabled
Specifies whether the filter is active and taken into account when the query runs.
Available values
Value | Description |
|---|---|
true | The filter is active and taken into account when the query runs. |
false | The filter is inactive and excluded when the query runs. |
Expression leftExpression
The expression to evaluate, usually a column.
Expression rightExpression
The expression to compare against leftExpression, usually a literal value.
Expression rightLessExpression
The lower bound of a range comparison. Used when "filterType": 3 (Between filter type).
Expression rightGreaterExpression
The upper bound of a range comparison. Used when "filterType": 3 (Between filter type).
object items
The collection of child filters. Used when "filterType": 6 (FilterGroup filter type). Keys are arbitrary labels used to identify each child filter.
SegmentFilterOptions segmentFilterOptions
The parameters of a segment membership filter. Required when "filterType": 7.
Expression object
The leftExpression and rightExpression properties, and their range variants, share the same object shape.
{
"expressionType": [Expression type],
"columnPath": [Column path],
"parameter": [Literal value]
}
integer expressionType
The expression type. This JSON layer only produces 0 (SchemaColumn type) and 2 (Parameter type) out of the full set of values available on the ExpressionType enumeration. Learn more: Filters class.
string columnPath
The path to a column relative to the root schema. Used when "expressionType": 0 (SchemaColumn type). Supports dotted forward references, for example, "Account.Name" filters contacts by their account's name. Creatio joins the related object automatically.
Parameter parameter
The literal value to compare against. Used when "expressionType": 2 (Parameter type). Its dataValueType property determines how Creatio interprets value.
Available values
Value | Name |
|---|---|
0 | Guid |
1 | Text |
4 | Integer |
5 | Float |
6 | Money |
7 | DateTime |
8 | Date |
10 | Lookup |
12 | Boolean |
Segment filter options object
The segmentFilterOptions object is required on a filter with "filterType": 7, and carries the parameters of a segment membership filter.
{
"segmentId": [Segment ID],
"includeRemovedMembers": [Include removed members flag],
"ignoreUserStatus": [Ignore user status flag],
"addedOnFrom": [Added-on range start],
"addedOnTo": [Added-on range end],
"removedOnFrom": [Removed-on range start],
"removedOnTo": [Removed-on range end]
}
Guid segmentId
Required. The ID of the "Segment" (SysDataSegment code) object record to check membership against.
boolean includeRemovedMembers
Determines whether previously removed segment members are included in the check. Out of the box, the value is set to "false."
Available values
Value | Description |
|---|---|
true | Any record that was ever a member matches. |
false | Only currently active members match, rows whose |
boolean ignoreUserStatus
Determines whether the segment's "Active"/"Paused" (user status) is taken into account when checking membership. Out of the box, the value is set to "false."
Available values
Value | Description |
|---|---|
true | Creatio skips the segment "Active"/"Paused" (user status) gate, so a "Paused" segment can still be used as a filter. The system/lifecycle-status gate still applies. |
false | Creatio applies the segment "Active"/"Paused" (user status) gate. |
string addedOnFrom
Optional. The inclusive lower bound on when the record was added to the segment (AddedOn column), in the ISO 8601 format.
string addedOnTo
Optional. The inclusive upper bound on when the record was added to the segment (AddedOn column), in the ISO 8601 format.
string removedOnFrom
Optional. The inclusive lower bound on when the record left the segment (RemovedOn column), in the ISO 8601 format. Meaningful only when "includeRemovedMembers": true.
string removedOnTo
Optional. The inclusive upper bound on when the record left the segment (RemovedOn column), in the ISO 8601 format. Meaningful only when "includeRemovedMembers": true.