Feb 14 2017 04:28 AM
Hi,
We are using the SPO REST API to PUT files into SPO document library. We are also doing a PATCH to update content and metadata. On the document library we have a SP Designer workflow that starts when item is changed.
It seems that the workflow is interfering with the PATCH as we are seeing occacional "microsoft.sharepoint.spexception: the file has been modified by" errors manifesting itself as a 409.
Turning of the workflow resolves the issue, but that is not an option.
Has anyone experienced something like this, and maybe have a solution?
Feb 14 2017 06:28 AM
Feb 14 2017 12:48 PM
I have actually tried this. I added a 5 minute "Pause" at the start of the workflow. This did not help. The thing is that the workflow doesn't actually do anything with the list item. It checks to see if certain metadata is set and on the time of the PUT and PATCH these metadata is not set so the workflow ends staight away.
We are using FilesConnect in Salesforce to move files in SharePoint. I fwe turn off the workflow everything works fine!
Feb 20 2017 03:02 PM
SolutionFeb 20 2017 04:55 PM
The challenge is as soon as one column update happens, the workflow is triggered while you are still updating other content on the record. There is no lock put on the record to prevent it from firing.
Try to turn off the item update event triggering for the list and see if that prevents the workflow from firing. Here is link to an article that might help - http://sharepoint.stackexchange.com/questions/94362/temporarily-disable-workflow-on-single-list-item
There are other challenges with batch updates but if it works for one record, then then could plan for batches.
Feb 21 2017 01:37 AM
Thanks a bunch! That seemed to be it. I will test some more and give and update later.
Feb 20 2017 03:02 PM
Solution