(null or yes) should be yes


I have a workflow where steps 1 and 2 may or not run (depending on conditions) but one of them always runs, e.g.:
1 - If condition A is true run custom workflow A
2 - If condition A is false run custom workflow B
both custom workflows return a success variable (yes/no)

then I want to run step 3 only when step 1 and step 2 completes, therefore I was using this condition:
3 - If step1.success is yes or step2.success is yes run custom workflow C

the problem I am facing is that when the workflows dont run I get a null in the success and the condition 3 is always failing:
(null is yes or yes is yes) => null

Shouldn’t this be yes?

Probably, yeah, because null = no for booleans (yes/nos) and (no is yes) or (yes is yes) = true. Report this bug https://bubble.io/bug-report

Where do you see ‘null’? As far as I know Bubble never displays that - it’s always ‘empty’ or some variation of that.

I think you should try null is empty
I agree that normally, null is like no in boolean however…

Can’t use is empty on yes/no

1 Like

You are right @georgecollier and I think the issue is there.
Because you cannot say null is yes when you consider that null is no in boolean (and for Bubble). null is no will return yes. null is yes will return no. The correct formula should be null is empty.
But you cannot set null is no… because if this return no… you will also have null is no.
So I think Bubble need to add a way to say “is empty”. But this will probably be a breaking change because Bubble doesn’t work that way.

So a workaround for @simao.rio1 is maybe to return a text instead of a boolean…

Well most things won’t allow an is empty state on booleans. It’s a boolean because it has precisely two states - yes or no, rather than yes/no/empty.

I absolutely agree. Normally, this should have one of the two states.

1 Like

hi @georgecollier dont you agree that (X or yes) => yes? Even if X is null?

Yes I agree, I think it’s a Bubble issue with returning data from custom events. An edge case they didn’t test…

1 Like

Can you share a screenshot of the conditionnal for step 3? Wondering if this is not an issue with parenthesis…

hi @Jici I have already changed the code to workaround this issue, but it wasnt an issue with parentheses. I have checked in the step-by-step debugger and the condition was failing because null or yes => null

1 Like

@simao.rio1, break it into custom events, it’ll make your app organization and logics work way better.
Let’s say you have the main action that can trigger 2 custom events based on your conditions.
Then you have a 3rd custom event that will be triggered in the end of each of those initial 2.
Doing this way your logic will be protected and the sequence of actions is followed accordingly.

That’s what he’s done

Actually it says custom workflows in the text and in the end we don’t really need to use the custom event return, we can just add the trigger to the final custom event at the end of the previous two how it was done until last week

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