SharePoint Workflow: how to update the item without triggering the workflow again

Posted by Philipp Schmid on Stack Overflow See other posts from Stack Overflow or by Philipp Schmid
Published on 2010-03-17T23:04:57Z Indexed on 2010/03/17 23:11 UTC
Read the original article Hit count: 617

Filed under:
|

I have a SharePoint workflow which is running whenever the item changes. The workflow communicates with an external REST service. If the service returns a string, I want to update one of the field values with that string. Unfortunately, this update will trigger another instance of the workflow for this item once the current workflow terminates. I end up with an infinite loop!

How I can prevent this from happening? SPListItem has Update(), UpdateOverwriteVersion(), and SystemUpdate() methods but none of them seem to prevent subsequent workflows from being triggered.

I could inspect the last modified timestamp of the item and terminate the workflow if the last update happened within a certain timespan, but I am looking for a more robust solution.

© Stack Overflow or respective owner

Related posts about sharepoint

Related posts about Workflow