Call web service from Nintex Workflow – To Copy List item between Site Collections

Requirement: Copy a List item between site collections.

Oops! Nintex doesn’t has any direct method to do that. It offers Copy/Move/Create list items with in Same site, but not between site collections. So, Lets seek help from Web services with Nintex.

Lets say, I’ve a Source-list and Target-List. What I want is: based on some conditions, copy the item from source list to target list. Here is the Nintex’s part.

  1. Drop a Call web service action in Nintex workflow
Nintex Call Web Service Action

2. Get the web services from the target site, e.g: http://SharePoint-Site.com/_vti_bin/Lists.asmx, and then configure the action as per the below picture

Call web service from Nintex To Copy List item between Site Collections

So, Look at the highlighted sections. Here you have to specify the GUID of the target list and supply the XML data for values.

<Batch OnError="Continue">
 <Method ID="1" Cmd="New">
		  <Field Name="Title"> {ItemProperty:Title} </Field>
		   <Field Name="Salary"> {ItemProperty:Salary}</Field>
 </Method>
</Batch> 

Here, the {ItemProperty:Title} and {ItemProperty:Salary} are fields inserted using Nintex “Insert Reference” button!

For the Update operation, we can use the same method, only  the CMD changes from NEW to UPDATE.

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
        <UpdateListItems xmlns="http://schemas.microsoft.com/sharepoint/soap/">
          <listName>my-List</listName>
            <updates>
              <Batch OnError="continue" PreCalc="TRUE" ListVersion="0"> 
              <Method ID="1" Cmd="Update"> 
                <Field Name="ID">{ItemProperty:ParentID}</Field> 
               <Field Name="ApprovedinTargetList">No</Field> 
            </Method> 
        </Batch>
   </updates>
        </UpdateListItems>
    </soap:Body>
</soap:Envelope>

The most important part here is: ID field, which maps our update operation with the particular list item. And XML is case-sensitive, e.g. “id” will not work, but “ID” will work!

Salaudeen Rajack

Information Technology Professional with Two decades of SharePoint Experience.

20 thoughts on “Call web service from Nintex Workflow – To Copy List item between Site Collections

  • April 17, 2019 at 11:05 AM

    Do you know if this is possible in SharePoint online?

    Reply
  • March 29, 2018 at 1:22 PM

    Hi, Thank you very much for this useful post,
    I was successful to run this workflow on my Test list but I have a problem that one Title replace the whole titles in Target list.
    I suppose to simply create 8 tittles from the source list in Target list, and each title is unique, I’ve added Query list action to query the IDs, and For each action to run Call web service. I’ve checked the XML but I can’t figure out the reason.
    I’m not sure if you’re checking this anymore, but any help would be appreciated!

    Reply
  • January 24, 2018 at 11:14 AM

    can we maintain the version history by this method as well ?

    Reply
  • February 25, 2016 at 10:33 AM

    I am working on a task similar to what you have posted above but in my source list i have Multiple lines of text,Date and Time and Lookup field and i am unable to copy them.

    Is there any way to do this?

    Thanks!!

    Reply
  • January 22, 2015 at 10:19 PM

    What about to remove an Item, would the CMD=”Remove”? Or how would that differ?

    Reply
  • November 7, 2014 at 3:09 PM

    Hi Salaudeen,

    I am trying to access external SOAP service in sharepoint page using AJAX, Jquery and I get access denied error. Can you please let me know how to solve this ? I am not allowed to use server code.

    Thanks !

    Reply
  • August 13, 2013 at 8:22 PM

    FYI this does not copy an item, it just creates a new item. UpdateListItems method adds, deletes and updates list items but it does not copy. What you are doing is creating a new list item and updating the meta data.

    Nintex/Web Services do not have a action/method to copy lists items between site collections or to folders with in lists.

    Reply
  • January 8, 2013 at 5:40 PM

    Hi Salaudeen,
    Thanks for this post as the content is hard to find on the web!
    Looking to see if you could assist…

    I’m am testing this solution prior to implementing but am hitting a wall right away when trying to create a new item in a target list from my source list.

    This is what I have in my SOAP Editor area:

    1496B2CF-21A2-4134-9B17-5744EB488DC7

    {ItemProperty:Title}
    {ItemProperty:Approver_x0020_1}
    {ItemProperty:ID}

    Originally, the BatchOn Error and we not in the code when I started to configure so I added per your example.

    URL I’m using for the target list is of a child site and is:
    http://opstd.uhc.com/onesite/intake/MoreTesting/_vti_bin/lists.asmx

    Not sure if you’re checking this anymore, but any help would be appreciated!

    Thanks!

    Reply
    • January 8, 2013 at 7:06 PM

      One common pitfall is: soap XML is case sensitive. ID and id are not same. check it once.

      Reply
  • August 10, 2012 at 2:31 PM

    Hi Salaudeen,
    I want to copy an attached file. Cannot figure out how to do that.
    Paul

    Reply
  • June 21, 2012 at 10:30 AM

    Hi!

    I am able to copy all the other list items to another site collection, except for one. Boolean type (yes/no)list item doesn’t appear to the destination list at all. Is there anything special I should know in these kinds of list items?

    Actually when I try to copy that boolean item, all the other items fail to copy too. If I try to copy items without that boolean item, everything goes fine.

    There are no error messages in the workflow and it seems to run good, but cannot get anything to destination list.

    Jack

    Reply
    • June 21, 2012 at 2:41 PM

      Hi Jack,

      You can use:
      TRUE

      or

      1

      Reply
  • May 31, 2012 at 5:31 PM

    Thanks for this. It is very helpful.

    How can I move items in document library using this method? Will this method work with document library ?

    John

    Reply
    • May 31, 2012 at 6:23 PM

      Sure, You can use Copy & Update web services. Here is the example:

      http://msdn.microsoft.com/en-us/library/copy.copy.copyintoitems.aspx

      http://msdn.microsoft.com/en-us/library/lists.lists.updatelistitems.aspx

      Reply
  • March 23, 2012 at 1:18 PM

    I was able to get the copy lis item going but Update does not seem to work

    Reply
    • March 23, 2012 at 6:26 PM

      Bhavneet,

      The above code posted from a working workflow. Compare your XML with the above provided XML on update section, Verify the ID of your existing List item.

      Reply
    • November 3, 2014 at 10:22 AM

      > should be line 6. This might cause an issue. Otherwise it is always to catch what has been returned from your request.

      Reply

Leave a Reply