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 …
The problem starts when for example I would like to change a “no” to a “yes” … I was thinking to change it like this …
… but I can’t find the way to say something like: Show = Current cell’s TraceProduct’s Show denied
I hope someone could help me with this!!! Thanks in advanced!!! Gerardo
I just edited this to describe a more accurate workflow example
You can have two separate events:
When button is clicked only when Current cell’s TraceProduct’s Show is “yes” > Make a change to Current cell’s TraceProduct: Show = no
When button is clicked only when Current cell’s TraceProduct’s Show is “no” > Make a change to Current cell’s TraceProduct: Show = yes
Or if there’s a checkbox that the user is selecting to show/hide, then you only need 1 workflow event and have Show = “Checkbox is checked” (assuming that checking it means show/yes)
Hi romanmg, I tryed what you wrote but I think I’m doing something wrong because I just doesn’t seem to work.
I will show you what I did …
After making this changes, he does make the change to the boolean values from “no” to “yes” but he doens’t do it the other way ( from “yes” to “no”)
Is this what you meant?
Almost! Since you have both actions happening under a single event, both of them will run, so technically what’s happening is it first gets changed to “no” (step 1), but then it meets the condition for step 2, so it will change it back to “yes”.
Move these actions to separate events with conditions.
Event 1: When icon is clicked and current cell’s show is “yes” > make change to current cell’s TraceProduct: show = no
Event 2: When icon is clicked and current cell’s show is “no” > make change to current cell’s TraceProduct: show = yes
Thanks a lot!!! It worked!!!
Sorry to ask but, I still don’t get it why it doesn’t do it right when they are in 1 event.
I do understand that both of the events will run BUT I assumed that each event will modify my data only when the condition applyies. That’s why I put the Only when condition.
For instance, if the show value is “no”, then I click the icon and it goes to the first event. He will change the value of show to “no” only when Current cell’s TraceProduct’s Show is “yes”, but in this case I won’t change anything because it’s already in no. Then he will go to the next event. Now he would change it because Current cell’s TraceProduct’s Show is “no”. I hope you get what I mean.
Once again, thanks a lot for your help!!!
Greetings Gerardo
If they’re both in the same event, it will always work one way, then never work the other way. Here’s why:
Step 1 = Change No to Yes, only if it’s set to No
Step 2 = Change Yes to No, only if it’s set to Yes
At the beginning of the workflow, if it was set to No, Step 1 runs. As soon as Step 1 finishes, the value is now Yes, which means Step 2 looks at it and says, “Well, the value is Yes, so I better change it to a No now.”