null filter does not work in a!queryFilter()

Hi,

I need to pull values from DB which does not starts with "ABC" for example.

a!queryEntity(
entity: cons!entity,
query: a!query(
filter: a!queryFilter(
field:"office",
operator: "not starts with",

value:"ABC"
),
pagingInfo: a!pagingInfo(startIndex: 1, batchSize: -1)
)
)

But this is ignoring null values, I want null values also to be returned along with other values.

So I just tried fetching only null values to see how it works. 

a!queryEntity(
entity: cons!entity,
query: a!query(
filter: a!queryFilter(
field:"office",
operator: "is null"
),
pagingInfo: a!pagingInfo(startIndex: 1, batchSize: -1)
)
)

this is giving me 0 results. Nots sure what might be the issue. Can anyone please help?

operator "not null" returns correct values, problem is with fetching null only.

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    For your primary use case above, i'm guessing you'd have better luck starting out with a LogicalExpression (set to the "OR" operator) where the filters passed in are "not starts with" and "is null".  That should make the query return both types of DB result.

    Also be aware that DB values of "null" versus simply "blank" will also be treated differently by query entity results.  It's frustrating but can be worked around.

Reply
  • 0
    Certified Lead Developer

    For your primary use case above, i'm guessing you'd have better luck starting out with a LogicalExpression (set to the "OR" operator) where the filters passed in are "not starts with" and "is null".  That should make the query return both types of DB result.

    Also be aware that DB values of "null" versus simply "blank" will also be treated differently by query entity results.  It's frustrating but can be worked around.

Children