Compare value to Null in a DataRule in App Studio

I have been trying to get this to work for a few days now with no success. I have a Data Rule that says IF ShipDtl_ShipCmpl = False or if ShipDtl_ShipCmpl = null. I know in this example that i can just say != true and it works, But other places where i would want to check null specifically don’t work.

As you can see even though the value is null it doesn’t trigger as true and disable the Shape component.
image
image

If you are comparing a string you can leave it blank, this will work.
If you are comparing a Integer you cant put a 0, this will work
but i can not figure out how to compare against a bool. Does anyone know?

Change your operator… Try CONTAINS a value of null

Result:
image

5 Likes

Do you have any idea why Contains works here but elsewhere simply saying equals “nothing” works?

1 Like

Was it a date field? maybe it was a string field instead and that is why and null string is nothing.

Just a guess.

1 Like

Null is not the same as empty. I can’t say I have a full grasp of the concepts, but an empty string (for example) is not the same as null.

A string can be empty (" ") but that may just means it contains zero characters, or zero bytes of information. So, if you think about bytes of information, the value is “0”. But that’s not null.

Null is the absence of a value. A boolean, for example can be “true” or “false”. But it can also be “null”.

Like, when you ask a yes/no question. It could be “yes” or “no”, but until you get an answer, the value is null. A little like Schrodinger’s cat.

Again, I don’t know all the programming logic and fully understand it. I just try everything I can think of until I find the right combination.

3 Likes

Ya that makes sense, My problem was that i had successfully made an empty check against a String and have it work.

Which is why i am so confused with this one, as checking a string from a Baq request didn’t work. I am thinking that you are right, the BAQ returns “” while when checking a String i created(w/ row-add widget) set its to null.

Well either way, thanks this was causing me to pull my hair out. using “contains null” appears to work on Bools and Strings at least for a dataveiw returned on from a BAQ query.