Hi Nintex Community,
I have a master list managing project data () for various units. Items created or updated in the master list need to be copied (or updated) to the corresponding units list.
Now the Copy Item action as well as the Update Item action do not allow choosing the target list dynamically based on the unit information.
What is the easiest way to copy or update items to the units list?
You should be able to use the "Copy to Sharepoint" and "Update Multiple Items" controls to do this. Both allow you to pass in the url for the destination.
Sorry - just realised that the Copy to Sharepoint action needs a Library or folder for destination and I don't believe it takes a list.. My Bad. The Update multiples should still be a valid option, but you may need to call a webservice to action the copy of the item.
Here's a document detailing under what scenario you shou use which control:
You can use REST to do both, here's a great article from Caroline Jung on how to do it, How to execute a REST API request with Nintex Workflow. It's got an example of an update.
The following link to Stack Exchange shows a REST copy example, sharepoint online - Copy List items using REST/JSON - SharePoint Stack Exchange
Hope that helps.
This looks like very advanced stuff. I haven't used Rest so far.
I try to get familiar with it.
I also just got the idea to use a State Machine instead. It might be overkill to achieve what I want but at least I could use the familiar copy and update actions.
Are there any restrictions regarding the number of states? Currently I need 22 states plus initial state.
Correction: no state machine necessary here. A simple switch would do the same.
I give it a try.
It turned out that REST API is not available for SharePoint 2010.
Sorry for not being clearer on the SP version.
I was able to use Call Web Service action with Lists.asmx and web method UpdateListItems.
For most of the fields to update (text, number, choice) is was not too hard following this article:
Select list in "Update Item" dynamically
Lookup fields and People/Group fields required some more effort.
Solution for People/Group fields:
Solution for lookup fields:
Still pending is a solution for multiple lines rich text fields.
If anybody has a solution for multiple lines rich text fields it would be nice to post here.
Solution for multi lines rich text fields: