I have setup a conditional server action and I’m having problems with it. I haven’t done very many of these, so I’m probably missing something.
I have two server actions where I am inserting and updating, then I set up a condition where if my post variable is false, run an update query and if it’s not, run a different update query. Only the “else” statement runs no matter what the post value is.
Thanks Teodor. I tried that and it still ignores the condition. No matter what order I put them in, it ignores the "IF’ part of the statement and goes directly to the “Else” part.
The flag I’m using for the condition statement is the “workstarted” input. It is coming from MS SQL as a bit field. It comes across in the response payload as false.
Can you please add a setvalue step in your server action and bind the {{$_POST.workstarted}} as a value there, enable output and see the result after the form is submitted in the Network > XHR tab? Post a screenshot of what is displayed there please.