Translate

Monday, September 16, 2013

Nintex Workflow: Create List Item using Web Service. Useful for accessing and creating list at different levels of site.

Solution: I got one requirement to create list item at different site level using OOB feature of SharePoint. We couldn’t use SharePoint Designer because that is blocked, SharePoint OOB feature won’t allow you to create this. We have Nintex workflow which allows you to do this using the web service activity.

Step 1: At your source list create a workflow with one Build String activity and add the below code and store it in a variable.

<Batch OnError="Continue" ListVersion="1" >
   <Method ID="1" Cmd="New">
      <Field Name='ID'>1</Field>
      <Field Name="FirstName">TestABC</Field>
   </Method>
</Batch>
 












Step 2: Add the call web service activity. In the URL section add the /_vti_bin/lists.asmx web service of the destination site. Select UpdateListItems from the web method. Put the destination list name. Add the variable used on the previous activity at the updates(xml) section.

 Your source list workflow should look like below.



 Now you are good to go, just make sure on the url you have a list DestinationTest and that contains a column FirstName.


Cheers !

5 comments:

  1. Thank you for that post! Very helpful!

    ReplyDelete
    Replies
    1. it will only move or copies jut one. We need to copy all the items.

      Delete
  2. Hello Rajdeep,
    do you know if it is possible to get the ID of the element that was created, like with the web service output in XML or some other way (but in the same workflow/action)?

    ReplyDelete
    Replies
    1. I haven't tried this, but I think using the same web service it should be possible. However, I would use a pause activity after the list item is created to ensure the ID is generated and ready for retrieval.

      Delete