Hi!
I'm trying to put logicalExpression within logicalExpression ( one of them will be with operator "AND" and the other one "OR")
and I dont know how to write it.
Where should I put the logicalExpression with the "AND" operator? for simplify it the "AND" contains the "OR".
local!dataSubset: a!queryEntity_18r3( entity: #######, query: a!query( pagingInfo: a!pagingInfo(1,-1), logicalExpression: a!queryLogicalExpression( operator: "OR", filters: { #### }
Discussion posts and replies are publicly visible
You can use the logicalExpressions attribute (note the plural) - this can take an array:
a!queryEntity( query: a!queryLogicalExpression( logicalexpressions: { a!queryLogicalExpression( operator: "AND" ), a!queryLogicalExpression( operator: "OR" ) } ) )
Hi,
Thank you for the quick response!
I did not understand how this query represent logicalExpression within logicalExpression.
I meant that the logicalExpression "OR" will be inside the logicalExpression "AND".
Could you verify?
Stewart didn't specifically add the AND operator at the top level, but that's essentially what's happening in his example. Here's an example with some more filters so you can see how it works:
a!queryLogicalExpression( operator: "AND", logicalexpressions: { a!queryLogicalExpression( operator: "AND", filters: { a!queryFilter( field: "isActive", operator: "=", value: true ), a!queryFilter( field: "status", operator: "<>", value: "Complete" ) } ), a!queryLogicalExpression( operator: "OR", filters: { a!queryFilter( field: "type", operator: "=", value: "Top" ), a!queryFilter( field: "region", operator: "=", value: "West" ) } ) } )
Thank you very much!