Workflow Runs on New Document Upload Before Metadata is Set?
That's the expected behavior! When Workflows configured to start on Item
creation, They'll start as soon as you upload a new document and will not wait until you enter
Meta-data. In fact, Metadata page is a Edit form!
Alright, How to Mitigate?
Alright, How to Mitigate?
- Change the workflow trigger from "Item Creation" to "Item Change" if possible. If you want to check whether the document is newly created, Just compare the Created & Modified fields. They'll be same when you upload a document for the first time.
- In beginning of Your workflows, Include the logic to check whether the metadata values are present. If not, Just wait for the metadata to set or end up the workflow.
- Alternatively, you can set the default values for your metadata fields, so that they will not be empty.
- You can set "Require content to be checked out" option, so that workflow will not run until you enter the mandatory fields and check-in.
- Using a Pause action may work (e.g. pause for 5 min) which I don't recommend however!
Thank you so much. This solved my problem flawlessly!
ReplyDeleteI have a SharePoint 2013 document library with mandatory metadata and a workflow runs upon document upload. However, during document upload when the metadata is entered in the second step, I am getting the following error "The file xxxxx has been modified by yyyyy on date/time" and the metadata is not saved. However, the workflow is running. Any help is much appreciated.
ReplyDeleteNilanjan, same problem here. Did you find a resolve for this?
ReplyDeleteFrom SPD, select workflow under consideration. On the right pane "Settings", uncheck Automatically update the workflow status to the current stage name.
ReplyDelete