applyWhen queryLogicalExpression not working

Certified Senior Developer

Hi, Im facing an issue in queryLogicalExpression where 'AND' operator is used and there are 3 query filters in it with applyWhen parameter is passed which is evaluated as false in all the 3 filters but still this expression got executed instead of ignoring it. Is the applyWhen parameter will work only for separate queryFilter and not for the filters added in logical expression? Could someone help me to understand the behaviour?

Thanks

  Discussion posts and replies are publicly visible

Parents
  • Yes, applyWhen absolutely works inside a!queryLogicalExpression().

    The reason your query is still running instead of being ignored is : When all filters inside a logical expression evaluate to false, Appian empties the list entirely. In Appian, an empty filter list doesn’t mean "ignore this query" or "return nothing", it means "return everything." The system treats it as a blank canvas with no restrictions, which is why your query still executes and fetches data.

    could u give us more clarity on how and where you are applying the applywhen parameter. a code snippet would be helpful.

Reply
  • Yes, applyWhen absolutely works inside a!queryLogicalExpression().

    The reason your query is still running instead of being ignored is : When all filters inside a logical expression evaluate to false, Appian empties the list entirely. In Appian, an empty filter list doesn’t mean "ignore this query" or "return nothing", it means "return everything." The system treats it as a blank canvas with no restrictions, which is why your query still executes and fetches data.

    could u give us more clarity on how and where you are applying the applywhen parameter. a code snippet would be helpful.

Children