We have a business requirement to close the tab and return back to landing page on Finishing the screen flow assignment. So we added "On Click" event on Submit button and added "Finish Assignment" and "Cancel" event as Actions. What we noticed that sometimes "Cancel" is fired before "Finish Assignment" is complete. This results in a modal window saying "You are about to close a work item which is not saved" with Save and Discard buttons. Our understanding is that these events should fire in sequence. Is our understanding correct ? Should we write an activity that will perform these two tasks and will be fired on "On Click" event ?
Actions should be synchronous. Action queue is paused before an action is executed and resumed only when the action is finished. Is the flowaction's setting 'If an assignment is not being performed -> Close the work object' not useful for you because that will do what you are trying to achieve here?
Yes Actions are executed sequentially (we can restrict the execution of few actions based on when condition but this option is available only for few actions). In your scenario there is no need to have 2 actions instead keep the FinishAssignment action as is and mention the AutoClose Harness in the flow action rule Action tab ( where you see If an Assignment is not being Performed- Select Show Harness and select AutoClose) which closes the opened tab and returns to its previous tab
Below is the setting in flow action's Action tab which Ganesh is talking about.
Currently your setting will be "Show Harness" Confirm, that's why you are seeing confirm harness. Change this to close the work object and let us know if you still face any issues after configuring this.