Toggle Yes/No Custom State

Just thought I’d share the solution in this thread:

by @J805

It’s a one-liner that uses “boolean algebra” to create an inverse function.

You can check out the full explanation on the linked thread/post.

image

Cheers and thank you to J805 for the solution

1 Like

Happy to help. :blush:

Damnit I wish I knew that, I made a form and it had 40 yes/no checkboxes so 80 workflows :angry:

1 Like

Not sure why this person shared this info AGAIN in this old thread as I shared it in earlier replies twice, @tylerboodman.

(Also, don’t feel bad about not having been able to figure this out. I literally tore my hair out for hours when I first started using Bubble. While I’m sure someone out there knew how to do it, the first mention of the correct method I’ve ever found is my own post here - way back in April of ‘18…

WTF is there no Boolean "NOT" Operator!?!?!? - #4 by keith )

2 Likes

Thanks @J805 for finding this solution!

@keith :smirk:

2 Likes

Nice approach

I have stumbled on a new solution to this as well. I might just be repeating some else’s previous post so apologies if so, but I haven’t seen this in the forum before and I’m trying to toggle states of things quite regularly:

Workflow - when object is clicked:
Set state of object (yes/no custom state):
Element: the element
Custom state: the custom state with yes/no
Value: The element’s custom state is no

So this evaluates to Yes if the current custom state is No, and it evaluates to No if the current custom state is Yes. It works well for me.