SaaS User & Company account creation... Bug?

I suspected that’s why you thought it was false… but it’s not… that’s not how it works…

If you have (as it turns out you do) privacy rules on the thing you’re trying to create that prevent it being found in searches then, obviously, it won’t be found in the search…

So when you check if one already exists with the given domain, the results will return nothing (search count is 0 will be true) and a new thing will be created, even if there is already one (or several) in the database.

However, if you use the debugger in step-by-step mode, it will appear that search: count is 0 is false… here’s why:

When you click the button to start your workflow in step-by-step mode, your workflow will run, immediately, in normal speed (at least sever actions, like creating a thing will), even though the debugger shows that nothing has happened yet (check your database to prove it - the new thing will be created as soon as the button is clicked - even in step-by-step mode).

So immediately the condition search: count is 0 is evaluated as true, and a new thing is created.

Then, you click ‘next step’ a few times until you reach the step to create the new thing (but in reality that step has actually been completed as soon as you clicked the button).

Now the the debugger will show search count is 0 as false (because the thing was already created , as the condition was initially true) - giving the false impression that the condition was false (which it is by the time it’s shown in the step-by-step debugger - but it wasn’t when the action actually happened).

I don’t think it’s a bug - it’s just the way it works… but it does confuse a lot of people…

So the debugger, in step-by-step mode isn’t much use for checking the actual order of actions, or how conditions are being evaluated…

What’s the reasoning for using < 1 rather than is 0 ? More performant?

Yes… it’s faster and costs less in WU… (it shouldn’t be… but it is due to a bug in the way the number 0 works in Bubble - which they’re working on a fix for: Search: count is 0? Or Search:first item is empty? - Tips - Bubble Forum)