Can someone please explain the difference between Set Field Value and Update Item, and what factors should influence the choice of which action to use?
Solved! Go to Solution.
The major difference I see between the two actions is that Set Field can only be used to update a field within the current list, whereas Update Item can be used to update values in other lists. In addition, the Update Item allows you to update multiple fields all at once, and allows you to specify a "where" condition. I would say that the Set Field action is just a watered down and less powerful action than Update Item but they can both be used to achieve the same thing. If updating a field in the current list, both should function the same as they are both added to the job queue for processing so performance should be similar if not the same between both.
I do notice, though, that workflows give an error when running multiple Update Item actions. I can place multiple Set Field Value just fine.
What I do when that happens for Update Item is to set the values into variables, then use the variables to place the values in one Update Item action at the end.
Thanks Mike. I always wondered that because I never used Update Item. Now that you say it, I was always in the list I needed to update. It makes sense.
Cesar Santos I would try using the "Commit Pending Changes" action after your Update Items if you are seeing this strange behavior. Usually these errors are caused by very specific things, such as invalid variable types or even a timeout issues. The Pause action can also correct some of these types of errors as well.
There's one other major difference. The Update item action will initiate any workflows setup to start when an item in the list is modified. The Set Field action doesn't. This can be very helpful for preventing continuous looping workflows.
Gerard Rodriguez - I am able to launch a secondary workflow that exists on a list item set to start when Item is Modified by using the Set Field action. Do you see some different behavior for this action?
Mike, yes the behavior I described above. We use this regularly to prevent looping when we have an OnModify workflow making changes to the item. Can't explain why it behaves that way if you're seeing different behavior - just thought it was by design. We are using NintexWF 2013 v184.108.40.206 if that makes a difference.
Yeah, I'm testing on 3.0.8 on-prem and Set Field does cause item modification to fire. I'm curious to see what others are seeing in their envs. as well.