Expression Rules

I have record type that get its source from data store entity and it has default filter and other user filters how can i query the same data using expression rule ?

for example we have fields in the data store entity      startedBy , status , location , department  , empId , addedOn

and the rule inputs for the expression rule are searchText , selectedLocation and createdOn

this is the default filter 

a!queryLogicalExpression(
operator: "OR",
filters: {
a!queryFilter(
field:"status",
operator: "=",
value: 2,
applywhen: a!isUserMemberOfGroup(loggedInUser(), cons!SP_MANAGER_GROUP)
),
a!queryFilter(
field: "startedBy",
operator: "=",
value: loggedInUser()
)
}
)

and this is the user filters that i want to use (this for user search ) 

logicalExpressions: 
a!queryLogicalExpression(
operator: "OR",
filters: {

a!queryFilter(
field: "empId",
operator: "=",
value:tointeger(ri!searchText),

 applyWhen:a!isNotNullOrEmpty(ri!searchText)
),
a!queryFilter(
field: "startedBy",
operator: "includes",
value: ri!searchText,

 applyWhen:a!isNotNullOrEmpty(ri!searchText)
),

},

ignoreFiltersWithEmptyValues: true()

)

and this one for dropdown user filters like date and location filter

a!queryLogicalExpression(
operator: "AND",
filters: {

a!queryFilter(
field: "addedOn",
operator: "between",
value: {
ri!createdOn - intervalds("2", "59", "00"),
(ri!createdOn + 1) - intervalds("2", "59", "00")
},
applyWhen: a!isNotNullOrEmpty(ri!createdOn)
),
a!queryFilter(
field: "location",
operator: "in",
value:ri!selectedLocation ,
applyWhen: a!isNotNullOrEmpty(ri!createdOn)
)},

ignoreFiltersWithEmptyValues: true()

)

how can i put them all together  to  get the right data

  Discussion posts and replies are publicly visible

Parents Reply Children
No Data