I’m pretty sure this is a bug, I logged it on the bug form, just describing here in case it helps anyone debugging their workflows:
It seems that doing a search and evaluating a test on a field with a condition that is negative, eg:
Do this workflow only when “search for myDataType:first item’s myBoolean is ‘no’”
or Do this workflow only when "search for myDataType:first item’s myText is not “some specific text string”
will incorrectly evaluate as a match and the workflow will run when there are no items in the search.
Doing the same test for a positive condition, such as:
Do this workflow only when “search for myDataType:first item’s myBoolean is ‘yes’”
will not match.
Checking to see if an item exists before evaluating the condition avoids this bug.
I made an example app to illustrate: Editor, Runtime Make a copy if you want to play with it since the Bubble team will use it for debugging.
I’m new, if I’m missing something please kindly point it out.
“empty is equivalent to no”… what you say? on further research I have discovered this is known as the “truthy / falsey” concept… omg, for a “no-code” platform this is a very geeky subject to wrap our heads around.
Apparently any of the following will give a positive result on a “yes or no” (boolean) test of “is no”:
empty
null
undefined
NaN
empty string ("")
number 0
boolean value “no” (false)
anything else, including the text strings “0”, “false” and “no” will evaluate to “yes”