best way to create a workflow to copy content from one list to another

  • 8 December 2015
  • 6 replies
  • 118 views

Badge +7

Hello,

 

I have two SharePoint 2013 custom lists, List A and List B.

I need to create a new item in List B and then copy content from certain fields in List A into the newly created item in List B.

 

Can anyone point me in the direction as to what would be the best way to do this with a workflow.

 

Thank you


6 replies

Badge +4

Hello,

Make a query list on your list A and after make a loop on your items.

For each item use action Call web service on Web URL/_vti_bin/Copy.asmx

Usually I use the web method CopyIntoitemsLocal with the sourceUrl and the DesunationUrl, automatically all metadata are copied.

I hope this can help you

Badge +7

Hello Damien,

Thank you for your reply.

I think I understand what you are proposing to do in the workflow.

Is there a way that you could provide an example for me based on what you have proposed. If you can this would be fantastic.

Thank you, Damien.

Badge +4

Hello Sean, no problem for an example, give me just more informations :

  • You want to start the workflow when an item is created in List A for copy it in List B ?
  • You want to start a workflow that copies all items from List A to List B in one shot ?
  • All fields that you want to copy are metadata of the item to copy (in list A) ?
Badge +7

Hello Damien,

Thank you for your reply. Here is some more information based on what you have asked.

1. In list A, I have a field called Status. The status column has three choices - Closed, Filled and Open. When the value in the Status column is changed to Filled is when I want the workflow to start.

2. When the workflow starts I want to copy certain fields from list A into certain fields in List B. As an example here are some of the fields that I need to have copied:

Requisition Number --> Requisition Number

Full Name --> Full Name

Department --> Department

Hiring Manager --> Hiring Manager

3. All fields that I need to copy contain metadata that is unique to the particular item in the list. None of this metadata is managed metadata, it is either information generated from information that someone has to enter or from other workflows (an example of information from other workflows would be and email address that someone would be assigned, and others ; see examples below:

Email Address - uses first name and last name to create email address - John Doe = jdoe@company.com,

Full Name - uses First Name and Last Name fields to create entry in Full Name field

AD Account - uses First Name and Last Name to create AD Account - John Doe = jdoe

* NOTE* - I have just had a request where some of this information also has to be copied over from List A into List C (List C is a Business Card order list). This can be run as a separate part of the workflow after the manager has completed filling in all of the information in List B.

Thank you for your assistance Damien. Hopefully this is clear enough to answer your questions.

Badge +4

Hello,

 

Ok so it's very simple, we are on a list workflow, so we have the item's context.

 

Find below my example that makes a copy from List A to List B (same logic if you want make another copy from List B to List C).

  • List A :

          01.png

 

  • List B :

          02.png

 

  • Create your workflow on List A that just build your field like Fullname, address email, AD account...

          03.png

  • Details of these actions :

          04.png

          05.png

          06.png

          07.png

          08.png

 

  • And before publish your workflow, set workflow options for starting this workflow when the status became filled :

          09.png

 

          10.png

 

  • Demo :
    • 11.png
    • 12.png
    • 13.png

 

let me know if you have any questions.

Badge +7

Hello Damien,

Thank you very much for the excellent answer and example.

Your example was very concise and extremely easy to follow.

Sean

Reply