How can I check if a variable/tag is / is not NULL/empty with a logic condition card?
THX
How can I check if a variable/tag is / is not NULL/empty with a logic condition card?
THX
Can it be NULL/empty??
When you create a variable you have to fill the default.
When you restart homey that value is set.
In my case a homescript returns ββ, so the tag is empty (of course I could return something else).
And yes, your answer is the reason for my question
Null is hard, but setting it to an Empty string (ββ) is very easy, because an empty string validates correctly when setting capabilities or tokens.
Answer:
Now you have an Empty text variable which you can use to see if a text-token or whatever is also empty.
As far as i know there is no way to set a capability/token-value to null.
You and @FKey are right.
It is even not possible to return null in a token with homeyscript or use it as a variable value out of the box.
Your advise works fine. And with the new inline homescripit it is not even necessary to use a global variable. Just for fun:
THX
Indeed, the global variable is handy tho, if you check it much: you just reference the existing gloval variable called Empty
Saves flowcards
Also, reading Result equals Empty is imho somewhat nicer then Result equals Result.
I agree!
Nice weekend