Unexpected match when item doesn't exist

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’”
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.

search for myDataType returns an empty list
first item returns an empty boolean
is no returns yes, because empty is equivalent to no

You probably will get what you intended if you check the count of the returned list.

The way search criteria work with empty fields can be unexpected, but that’s a different topic.

“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 string ("")
number 0
boolean value “no” (false)

anything else, including the text strings “0”, “false” and “no” will evaluate to “yes”



This topic was automatically closed after 14 days. New replies are no longer allowed.