0

I have been struggling with this issue in the last few days. I have a simple SP online list with Status and comments fields. The flow is triggered when the Status changes to Completed. What I want to achieve is when I update the comment filed(it can be at anytime even after the status change completed), the flow doesn't begin. At the moment, the flow is triggered when the item gets modified, and every time I add something to the comment field, the flow will start.

Kind Regards

2
  • Hi Harris :) Do you have a condition in the trigger action so that it only fires when Status is set to Completed? If so then it should still fire when it is edited and the Status is still Completed. You can paste in you trigger condition here for a look. When that is working you need to Get changes of the item (thats an action) to check if the Comment field has changed, and your flow can continue or cancel.
    – RuneBH
    Dec 8, 2021 at 8:51
  • Hi Rune, this is my conditional trigger which works if the status is not equal to completed, and I can update the comment field as many as I want, and the workflow won't start. However, when I change the status to completed, every time I update the comments column, it will trigger the workflow, which is wrong. @equals(triggerOutputs()?['body/Status/Value'], 'Completed')
    – Harris
    Dec 9, 2021 at 0:42

1 Answer 1

0

so as I understand it, you wont the flow to trigger when status is set to Completed, and after that not to run again.

Right now your trigger condition will run on every edit as long as the Status is set to Completed. So you need to add one more condition so that it only runs the first time it is set to Completed. There are different ways this can be achieved, but I think in your case this makes the most sense:

  1. Add another field "WorkflowHasRun" and set the fields default value to "No"
  2. Update the trigger condition to @and(equals(triggerOutputs()?['body/Status/Value'], 'Completed'),equals(triggerOutputs()?['body/WorkflowHasRun/Value'], 'No'))
  3. Add an update item action to your workflow that sets the "HasWorkflowRun" value to "Yes"

This way the workflow will only fire once per item after it is set to Completed.

There is of couse also the possibility to let the flow check if the Status field has changed (with the Get Changes action), but this is perhaps more suited if items can go back from the Completed status and then later again go to Completed.

Hope it works :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.