I have a workflow that requests manager approval (flexi task), then uses 'Set Field Value' action to write 'approved' or 'rejected' in a field. The workflow is completing successfully, however, it only occasionally actually writes 'approved' or 'rejected' in the list field. Often it leaves it blank. At the very end of the workflow process, I set item permissions to read only for everyone except site owners.
I have given all domain users contribute permission on the Workflow Tasks' list (the manager approval link did not function before this).
Domain Users (everyone) also has contribute permission on the list that the workflow is attached to.
When we tested this it worked fine, but now that it's live, we often get completed workflows, but the set field value fields are blank. I added a Pause action after the set field value to see if the set item permission was completing (and thus restricting write permission) before the set field value action completed.
I also set item permissions within the flexi task approval to contribute, just in case.
Any other thoughts on my root cause?
Solved! Go to Solution.
Thanks for the reply. I should have mentioned that I previously had a 'commit pending changes' just before the pause action. In that case, the workflow stuck at commit pending changes and still did not update the value in the field.
Did a little more digging and that's exactly what the issue is. When the workflow runs, the actions don't necessarily happen in the exact same order as you have it laid out in the workflow. Here is a good post that explains the timing of actions, and actually address your exact scenario. . When the workflow runs, the permissions are being set before the update. Since you're setting it to "read", the update won't happen since that user won't have permissions. I'm assuming the ones where the value is getting updated is because it was the site owner that ran the workflow. If you add a Commit Pending Changes action after the Update Item, it should fix your issue.
What do you mean by "stuck"? The workflow wouldn't complete? Commit Pending Changes shouldn't cause the WF to get stuck. You may have some other issue going on if that's the case. You may need to take a look at the ULS logs to see if there is some problem. Troubleshooting ULS Logs.
I've found set item value action unreliable too.
I was not able to pinpoint reasons but I found it working certain time after workflow is (re)published. then it rejected to make updates with no apparent reasons. only way to recover functionality I've found was to delete the action from workflow and re-add once again.
I've experienced that in several scenarios and in different envs.
I completely stopped to use it and do all the item updates with item update or multiple items update actions,
Didn't realize that. I typically use the Item Update just because it's more flexible than Set Item. Is Nintex aware there are issues with "Set Item"?