This has the added advantage of being able to use Conditions much easier as well. For example, if the thing that triggers the toggle is a button, you can indicate its state by modifying the text on the button in the button’s Conditional tab, like:
When SomeBoolean is “no” > Text is “Off”
When SomeBoolean is “yes” > Text is “On”
Well, the original question is several months old and the OP probably isn’t paying attention to this thread any longer?
(The other thing I’d say about this, as I’ve pointed out in other threads on the same subject: I felt like I was going crazy when I couldn’t originally figure out where the “not” operator was in Bubble. Turns out it’s there, it’s just not an operator… You just have to evaluate the state. This is one of those rare Bubble things that would be perplexing to both a beginner and an experienced developer. It’d be much nicer I think if there were also a :not or :inverse or :negate operator on Booleans and it’d feel much more obvious.)
Thank you so mucho @JonL for this, even though @keith idea works, the modulo idea is, in my understanding, better, because you just need to use only one event to do the toggle, instead with keith’s idea, you would need two events, because if you toggle in an action, then the following action goes back to what we just toggle before, so at the en is a double toggle, so doesn’t work in the same event…
It’s been awhile this post is here. But maybe someone will find this useful. I found a much cleaner way to do it. It uses two state values. One is your yes/no, one is a number type. It goes like this:
Initial state value: yes and 1
Set No if value is yes and if number is 1
Set number to 0
Set Yes if value is no and if number is 1
Set number to 0
Set number to 1
When one of the events is activated it sets the number to 0 blocking the next action. It’s like using a ‘block’ Uno card on the next player.
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…