cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
tolbrich
Nintex Newbie

copy item and update item action with variable target list names

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?

Thanks

Thomas

Labels: (2)
0 Kudos
Reply
7 Replies
mapeacock
Nintex Newbie

Re: copy item and update item action with variable target list names

Hi Thomas,

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.

Cheers,

Mark

0 Kudos
Reply
mapeacock
Nintex Newbie

Re: copy item and update item action with variable target list names

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:

Copying items in list/libraries

Cheers,

Mark

0 Kudos
Reply
janeyres
Nintex Newbie

Re: copy item and update item action with variable target list names

Hi,

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.

Jan

0 Kudos
Reply
tolbrich
Nintex Newbie

Re: copy item and update item action with variable target list names

Thanks Mark.

0 Kudos
Reply
tolbrich
Nintex Newbie

Re: copy item and update item action with variable target list names

Thanks Jan.

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.

0 Kudos
Reply
tolbrich
Nintex Newbie

Re: copy item and update item action with variable target list names

Hi Jan.

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:

Re: Using UpdateListItems doesn't appear to support Person/Group field type

Solution for lookup fields:

http://sharepoint.infoyen.com/2012/03/20/how-to-update-list-items-using-sharepoint-web-service/ 

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.

Thanks

Thomas

0 Kudos
Reply
tolbrich
Nintex Newbie

Re: copy item and update item action with variable target list names

Solution for multi lines rich text fields:

UpdateListItems Web Service Adds Strange Character to Rich Text Field

<Field Name="Body"><![CDATA[{WorkflowVariable:txtRichText}]]></Field>

0 Kudos
Reply