greg11
December 5, 2020, 3:11pm
1
Hi
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…
[image]
But I would like actually to change it to the opposite value that it’s stored on my database. Here an example …
[image]
The problem…
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.
Cheers!
4 Likes
J805
December 5, 2020, 3:32pm
2
Hey
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
Toggle = yes is no (which is false)
So the toggle would turn to “no”
If it is currently no , it would look like this
Toggle = 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?
9 Likes
greg11
December 6, 2020, 1:31am
3
Yupp, That is even faster!
Totally make sense.
Cheers!
1 Like
J805
December 6, 2020, 1:59am
4
Glad it made sense.
@j805 www.NoCodeMinute.com
For All Your No-Code Education Needs:
One-on-One Tutoring
eLearning Hub
Video Tutorials
No-Code Classes
Fantastic solution ! Reminds me of math classes (boolean algebra) haha.
Would prefer a :not or :inverse function, but this rocks.
1 Like