Filtering by multiple conditions

Hi. I need to learn how to apply multiple conditions to a query filter as illustrated below. What is the correct syntax to achieve this as the compiler suggests there is an issue but the test call seemed to work. Thanks.

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    As Josh already mentioned, you need to use the logicalExpressions parameter (passing in an array of a!queryLogicalExpression() objects, which can be nested to many levels if really needed).  This concept is needed when applying more than one filter because otherwise Appian has no way of knowing whether to require ALL of the filters or ANY; the logical expression allows you to set the filtering behavior to either "AND" or "OR", which will accomplish these.  What's neat about this is that through well-planned nesting and combination of operators, you can accomplish some surprisingly graceful querying combinations.

    Just out of curiosity tho, what gave you the impression that parameters like "field2, operator2" etc would be valid?

Reply
  • 0
    Certified Lead Developer

    As Josh already mentioned, you need to use the logicalExpressions parameter (passing in an array of a!queryLogicalExpression() objects, which can be nested to many levels if really needed).  This concept is needed when applying more than one filter because otherwise Appian has no way of knowing whether to require ALL of the filters or ANY; the logical expression allows you to set the filtering behavior to either "AND" or "OR", which will accomplish these.  What's neat about this is that through well-planned nesting and combination of operators, you can accomplish some surprisingly graceful querying combinations.

    Just out of curiosity tho, what gave you the impression that parameters like "field2, operator2" etc would be valid?

Children
No Data