0

I have a document library with 4 fields, I have a workflow set to run on update. Part of the workflow sends an email, all is working fine, but when I update 4 fields I seem to get 4 emails instead of a single email.

Has anyone else experienced this? If so is there a way to only execute the workflow once instead of once for each field edited?

1

The workflow will run every time the item is modified. So if you have a workflow that states send email when Field 1 is not empty and then you enter a value, every time you modify the item it will send the email, regardless of whether or not you modified that particular field or not.

To get around this you could create a workflow as a new item workflow and use the wait for field change in current item action. This will ensure it fires the email only once.

If it's important to use a change item workflow, you could also create a hidden field and set/check it to make sure it doesn't fire the email duplicate times. Below screenshot shows how that works.

enter image description here

  • Investigating more is seems to have nothing to do with the amount of fields as I am not always getting the same number of emails. The workflow runs "on update" which I would have though means once when the document changes but its seems to be many times whether it is a change to a single field or multiple fields. – mgrenier Apr 12 '17 at 19:52
0

I developed a workaround but if anyone can help with the actual issue I would still be interested to know how to make the workflow only run once or even if I can, just know why it runs multiple times on a single update.

My workaround was to create a ModifiedDate and ModifiedTime field as well as UpdateDate and UpdateTime variables. The workflow sets the UpdateDate to the value of the Modified column in ShortDate format and the UpdateTime to the Modified column in the ShortTime format. I had to do this because the workflows don't run at exactly the same time they are a few seconds off, doing this eliminates the seconds in the time.

I then check if UpdateDate == ModifiedDate and UpdateTime == ModifiedTime, if not then set UpdateDate = ModifiedDate and UpdateTime = ModifiedTime. If they are already equal end the workflow.

The only issue is if you actually perform multiple updates on a single fine within a minute the workflow will only run on the first change, this is not a scenario I am likely to encounter so I am ok with this limitation.

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.