I had a requirement like first to update the list item, and immediately need to take the count of updated items.
I spent quite amount of time to achieve this, First tried by doing simple workflow
1. Update list item
2. Query list (query the same list which updated)
Here after running this, started getting uncertain results. Sometime it works and fails.
Started applying workarounds to that
Tried to apply “Pause for” action in between, like below image.
Result was again uncertain, it pause was getting struck, was not resuming the workflow even after specified time.
I goggled and found many issues are reported for the same issue,
Third workaround was to add some loop which can add some pause before query, somehow even after safe loop, result was uncertain.
Finally found the impressive feature of Nintex, which has saved from all these hassles.
“Commit Pending Changes” – How exactly it is working ?
SharePoint workflow not starting the workload immediately, that means if I am adding update list item action, so its not sure that it will go and update the item at the same time, SharePoint doing batch job for it. As a result we are getting wrong result while querying it immediately.
As well other important thing to remember that The SharePoint workflow engine doesn't necessarily commit batched operations in the order they are displayed on the designer
Commit Pending Changes will wait/pause the workflow or say it waits until the workflow commits all other batch job started then after will move further.
Impressed with this Workflow action, Hope this piece of information will save your time!