Empty resultset evaluation

Hi,

I am new to Appian and in learning phase. I would like to know how do I treat empty resultSets while using using a!forEach  combined with a!queryEntity

My requirements:

  1. Query a table
  2. When there are no results, return false 
  3. If there are results, iterate the results and return if the result set contains non blank items of a column

I had added an if condition in a!forEach expression. I am using fv!itemCount>0 condition which works fine only when there are valid results. it is not going into the false block when the resultset is emtpy.

How do i check a!queryEntity returns an empty entity/ data without any results?

Your help is much appreciated!

Please ignore any typos/syntax errors on the below snippet. 

load(
local!localCollections: a!queryEntity(
entity: cons!MY_ENTITY,
query: a!query(
logicalExpression: a!queryLogicalExpression(
operator: "AND",
filters: {
a!queryFilter(
field: "myPK",
operator: "=",
value:6
),
ignoreFiltersWithEmptyValues: true
),
pagingInfo:a!pagingInfo(startIndex: 1, batchSize: - 1
)
),
fetchTotalCount: true

),
a!forEach(
items:local!localCollections,
expression : if(fv!itemCount>0,
rule!GBL_isNotBlank(index(fv!item, "status", null)),
true()
)
)
)

  Discussion posts and replies are publicly visible