I was excited about the new Switch action in O365.
I have tried to add it inside a State Machine
But when I want to save, here is the error I receive.
If I remove the 3 Change State, I can save. I have selected a State in the 3 Chaneg State
Regards,
Christophe
Best answer by hardyj
Hi Christophe,
Thank you for bringing this to our attention, and sorry to have to put your excitement on hold. But good news, our team has investigated and resolved this issue. Please feel free to try again, it should work as expected.
Thank you for bringing this to our attention, and sorry to have to put your excitement on hold. But good news, our team has investigated and resolved this issue. Please feel free to try again, it should work as expected.
So sorry you are still having a problem and I appreciate your feedback. I will get our developers and testers right on to it, to see if they can reproduce it. If they can then to make corrections and test thoroughly the scenarios with Switch within a state machine.
We could not replicate the problem but believe we can see what you were referring to. I have answered this specific case in more detail directly to you.
For others that are following this trail, I would like to highlight a few a few points (documented in the help file):
A state Machine will only evaluate the the change in state from a "Change State" action at the end of the State Machine and not immediately after the Change State action i.e. any actions after the Change State action but before the end of the State Machine will execute.
The Switch action behaviour in NW365 has changed in comparison with the on-premises version. If there is not a valid value of the Switch variable And the "Other" branch has not been selected then the workflow will suspend with error and optional error message.
If you wish to replicate the on-premises behaviour and effectively bypass the Switch Action then select the "Other branch" but leave the "Other branch" empty (no actions).
Why have we done this? It leads to safer Workflow design in that any unexpected non-valid value is trapped or the behaviour of ignoring the Switch Action on an invalid switch variable value is explicitly intended by the designer.