Question

Filter lookup field with or conditions

Hello, 

 

I wanted to filter a lookup the contains multiple OR conditions.

I tried it as given in the below link

https://community.creatio.com/questions/freedom-ui-filtration

 

It works fine for a single condition. 

I also tried using by making Right Expression as an array, It didn't worked.

 

Thank

Gargeyi.G

 

Like 0

Like

1 comments

Hello,

 

The idea here is to use the Terrasoft.LogicalOperatorType.OR and specify the filtration inside as in the following example:

"DataGrid_6477jgb_PredefinedFilter": {
					"value": {
						"items": {
							"9a10762b-e098-4df1-9f2f-808b0f2a1e1d": {
								"filterType": 1,
								"comparisonType": 8,
								"isEnabled": true,
								"trimDateTimeParameterToDate": true,
								"leftExpression": {
									"expressionType": 0,
									"columnPath": "CreatedOn"
								},
								"isAggregative": false,
								"dataValueType": 7,
								"rightExpression": {
									"expressionType": 2,
									"parameter": {
										"dataValueType": 7,
										"dateValue": "2022-10-02T14:00:52.067Z",
										"value": "\"2022-10-02T17:00:52.067\""
									}
								}
							},
							"3027b84f-c411-4bd4-adea-064011d278fa": {
								"filterType": 1,
								"comparisonType": 7,
								"isEnabled": true,
								"trimDateTimeParameterToDate": false,
								"leftExpression": {
									"expressionType": 0,
									"columnPath": "Age"
								},
								"isAggregative": false,
								"dataValueType": 4,
								"rightExpression": {
									"expressionType": 2,
									"parameter": {
										"dataValueType": 4,
										"value": 18
									}
								}
							},
							"97395925-0187-4dda-8c82-777172c5e74c": {
								"filterType": 4,
								"comparisonType": 3,
								"isEnabled": true,
								"trimDateTimeParameterToDate": false,
								"leftExpression": {
									"expressionType": 0,
									"columnPath": "Country"
								},
								"isAggregative": false,
								"dataValueType": 10,
								"referenceSchemaName": "Country",
								"rightExpressions": [
									{
										"expressionType": 2,
										"parameter": {
											"dataValueType": 10,
											"value": {
												"Name": "Argentina",
												"Id": "7347f03f-d4d0-4553-9231-855f23623b94",
												"value": "7347f03f-d4d0-4553-9231-855f23623b94",
												"displayValue": "Argentina"
											}
										}
									}
								]
							}
						},
						"logicalOperation": 1,
						"isEnabled": true,
						"filterType": 6,
						"rootSchemaName": "Contact"
					}
				}
			}

In this case the contact where CreatedOn >= 2022-10-02 or Age > 18 or Country is Argentina will be returned. This should be inserted into the lookup attribute as in the example from the provided community thread and will work for the lookup column.

Show all comments