I was trying to have a step in workflow that would flip the boolean yes/no value to an opposite state. If the state of an element is “yes” I want it to change to “no” on click. If the state is “no” I want it to change to “yes”
The answer I found on the forum was looking a bit lengthy:
Hi everyone, I cannot seem to find how to change the value of a yes/no field to the opposite value that it is already stored in the databse.
Could anyone help me with this?
The name of the field is Show and it’s set as “yes”(true) when I create a new order in my app. Right now, what I can do is change it to the value “no” (false). This is what I mean…
But I would like actually to change it to the opposite value that it’s stored on my database. Here an example …
After some tinkering, I have found a solution that more people might find helpful. Format bool as text and keep the “no” value empty. Is empty? “yes”!
I hope this will be helpful.
Thanks for the suggestion. There is a better way to do this than the other post. You only need one workflow without any complications.
I figured it out eventually.
When changing the field it would look like this (I will try to post a simple screen shot later when I’m at my computer, probably Monday)
Let’s say the field name is going to be
Toggle and it’s a yes/no field.
To change it to the opposite it would then look like this:
Toggle = Toggle’s current yes/no is “no”
Meaning if it is currently
yes it would like this
yes is no (which is false)
So the toggle would turn to “no”
If it is currently
no, it would look like this
no is no (which is true)
So the toggle would turn to “yes”
I think a screenshot would be clearer though. I will upload it soon for a simple example.
Does that make sense?
Yupp, That is even faster!
Totally make sense.
Glad it made sense.
For All Your No-Code Education Needs:
Fantastic solution ! Reminds me of math classes (boolean algebra) haha.
Would prefer a :not or :inverse function, but this rocks.