Copy List Item to New – Another Method
Back in 2011, I wrote a post Click to Copy List Item to New. I’ve had several requests for a re-write of this for 2013. Actually, this method I’m going to show you can be done in 2010, 2013 and Office 365.
In this concept, I’ll show you how to create a workflow that simply creates a new item and pre-populates the columns with values from the current item. In this example, I’ll be using a list called “New Hires” (which is using the contact list template). If someone has entered a new hire into the list, and wants to quickly add another one that’s mostly the same, in this case the first and last name fields would be the only difference. Here are the steps:
- In your new workflow (I’m naming mine Copy New Hire), click the button in the ribbon called Initiation Form Parameters.
The reason we’re doing this part, is so that when they click to copy a new hire, they will be presented with a form to fill out the first and last name of the next new hire.
- Click the Add… button, and the first Field Name will be called First Name. Keep the default information type as a single line of text. Click Next.
- Leave the default value blank, and click Finish.
- Repeat step 2, creating a second field called Last Name the same way.
- On the Association and Initiation Form Parameters screen, click OK.
- Add an action to your workflow, called Create List Item. Click the blue words this list.
- For the List drop-down box, I’m choosing my New Hires list, so I’m really just creating a new item in the same list that I’m running the workflow in.
- Any required fields in your list will automatically show here with asterisks next to them. Also, if you’re using multiple content types in your list, the Content Type ID field will show. Click to select the Last Name field, and click the Modify button.
- Where it says To this value, click the fx (function) button. For the data source, choose Workflow variables and Parameters. For the Field from source, choose Parameter: Last Name. Click OK. (twice)
- The idea is that although we’re going to copy this item to be a new one, there are usually going to be one or two fields that are going to be different. Those are the ones that we create as parameters to pass to the new item. In this case, it’s just first and last name, so all of the other fields will end up getting set up with the same value as the item we’re copying. In this case, the last name was the only required field, so it was the only one showing on the Create new List Item screen. I still have to add a bunch of other fields here. Click the Add button. For Set this field, choose First Name. For To this value, repeat what you did in step 9 for the last name, except this time you’re using the parameter called First Name. Click OK.
- Now that the two parameters have been added (you may have more in your own solution, however many you need), it’s time to add all the rest of the fields. Click the Add… button. City is going to be my next one, so for Set this field, I choose City.
- Click the fx (function) button next to To this value. The Data source should be Current Item, and for the Field from source, I choose City also. Click OK. Click OK.
- My next field is going to be Company. Repeat steps 11 and 12, but instead of choosing City in both places (in purple), I choose Company.
- Repeat steps 11 and 12 for all of the other fields in your list that you want to be pre-populated when the new item (copy) gets created. Notice in this screenshot that the first and last name fields are from parameters, and all the others are just going to be a copy of what is in the current item.
- When you’ve finished adding your fields, click OK. If you are using a SharePoint 2013 workflow, you’ll need to add a Go To action in your Transition to stage, but then the workflow is ready to publish! (I also gave my stage a pretty name other than Stage 1)
- In your New Hires list in SharePoint, go to the List tab in the ribbon and click the button New Quick Step. Alternately, you can open SharePoint Designer, go to Lists and Libraries, and click the name of your list there. The Custom Actions are the exact same thing as Quick Steps.
- Instead of using the generic screen for creating a new custom action, called Create Custom Action, click cancel. Put your cursor in the section at the bottom called Custom Actions. Once you do that, you’ll see Custom Actions in the ribbon, with the drop-down box for a new Custom Action. Here’s where it is when you’re on that list’s settings page in SPD:
- Click the Custom Action drop-down box in the ribbon. Choose List Item menu. Keep in mind that you can create many different types of custom actions that all do the same thing, these custom buttons will just show up in different places such as the list item menu, the Display Form ribbon, etc.
- Name your custom action Copy to New. Or you can call it whatever you want, really. Type a description, so that people will know what this button does. In the section called Select the type of action, choose Initiate workflow. Choose the workflow you just published, mine is called Copy New Hire. Click OK.
Extra notes: Keep in mind that if you have images that are 16×16 or 32×32, stored in SharePoint, you can fill in the button image URL field as well. Also, in this workflow’s Start Options, I have it so that it can be manually triggered. If your workflow is not allowed to be manually triggered, it will not show up in the list of workflows to select from when choosing Initiate workflow as the action for your custom action.
- Now, when I go to my New Hires list in the browser, and I click the ellipsis or drop down box on an item in the list, “Copy to New” is now an option in that drop-down. I click it, fill out the parameters, and then as soon as I click Start, the new item gets created.
That’s a pretty simple solution, but there are a couple of issues. The initiation parameters don’t allow us to do required fields, so it will allow people to kick off the workflow without actually filling in the parameters. If a fields is required, it would then have the words “No Title” in it, instead of any actual first or last names.
Another issue, is that after the workflow runs, it bounces the user back to the homepage of the site. So although the item does get created, they don’t immediately see it. One super simple solution to this would be to put a list web part on the homepage called “My New Hires” and make it have a filter of “Created By” is equal to [Me] and for it to be sorted by the Created date descending. That way, even though they get bounced back to the homepage, they’ll immediately see the item they just created.
Here’s some more info about custom actions / quick steps:
- SharePoint Power Hour Episode 44- Quick Steps
- How to create a Quick Step and Custom Action to start SharePoint 2013 workflow
Laura I’ve tried adding the custom action to initiate a workflow but the button doesn’t seem to show up in the Disp Form if it is an InfoPath Form. I’ve tried different methods methods of entering in the Ribbon Location to no avail. I’ve used this:
This does not seem to work. Have you run into this issue before? I can be reached o Twitter @Zygma359
Is it possible to take a list item(document) and move it to another library after edits have been made to the document? What I am trying to accomplish would be for the user to open my template in one library, make their edits (not be able to save over the template) and have their edits saved in another library…
Adam, I see that, but I don’t know of a way around it off the top of my head.
Marcus, sure I just wrote an article about that concept:
Thank you for this solution! It is elegant and is going to make my users very happy!
Great Post, it’s work well in my List (workflow 2013), I create temp List, implemented Your method on workflow 2013 and copy item to temp List, on temp list I created workflow 2010 for create document (action : Create Item List) than put in Document Library.
Now user can get Word document with data each related to my List.
One question, Is it possible to put lookups data on paramaters? or any alternative? please your advice.
Is it possible to copy the attachments of the existing item?
I want to accomplish the same result: creating a new item in a list based on an existing item. But instead of using workflow, I’d like to do this from the Edit form, by (optionally) “Saving as new”. I only have access to Infopath & Sharepoint designer, so a bespoke solution that requires C++ isn’t an option for me.
I tried setting ID to blank and zero in the hope that would force creation of a new item, but that didn’t work (caused an error).
Any pointers would be welcome.
Thanks for the post, the copy work great. Bu when I configure my Source parameter (e.g. &Source=/sites/Lists/TestReview/CustomEdit.aspx) with the redirect URL of the custom edit form and then save the changes I get a Save Conflict error .. as if the workflow has not terminated by the time my edits are saved .. do you know anything about that?
[I’m using Sharepoint 2010]
Thanks for sharing Laura. It was very helpful.
It worked for me for fields Multiple Lines of Text, Single Line of Text, Dropdown, Radiobutton, People and Group, and Checkbox but not for Lookup field.
Hi Laura – Thanks for the post. I am facing issue. I have created a SharePoint Group to have contribute access on a list. On the site this group has read only access. In this list I am trying to do the Copy Item function. I have added the App Step to elevate permission. The problem is when a person from this SP group tries to Copy Item is redirected to the Access Required Page “Sorry, you don’t have access to this page “. The page is showing the source in the URL
When I explicitly add user to the Contribute or Approver group of the site. Copy Items works absolutely fine. But the problem is I can’t give them contribute access on the site. just on the list.
I don’t understand where is the problem.
Could you please throw some light?
This is simply awesome. Just follow the steps religiously and you wont go wrong.
Thanks Laura. Good to have read this one.
No, lookups are stored in a different way, as the ID of the item, so it would be extremely tricky to try and figure that out.
No, attachments can’t be copied with out-of-box functionality. 3rd party workflow products would have to be used.
Adam, you could do that with an InfoPath form library form. When you create your submit data connection, it lets you decide what the filename naming convention is. So, you’d have to use logic that would give it a different filename, so that submitting it would create a new item. I don’t have a blog post or anything on that, but chapter 9 in my InfoPath book goes over the whole publishing/submitting concept and the intricacies of it.
That timing thing sounds very tricky, and the workflow could just be taking too long due to server performance, which is not normal.
Sorry, I’ve never seen that happen, try adding them to the “restricted readers” out of box group.
Thanks for sharing your knowledge … do you have any tips for copying multiple list items to new? for example…selecting multiple list items using the checkboxes then running a Copy to New Item workflow on the selected items.
Great article Laura, thanks for updating this and sing clear images.
I’ve added this as a Button on a Display Form and it works perfectly.
Do you know how I could tie this to the logged in user? Example, on the New Hire list copy MY last item not THE last item. Does that make sense?
Is it possible to copy a folder which contains multiple docs into the same list. ie each client will have the same set of files so we need to create a folder for each client.
Hi Laura, It is Great Solution but do you think I can mange the way to copy my item to another sub site? this is my big problem and I am looking for a logic way than Java
Will you marry me, Laura?
Workflow creates a new item but after editing it disappears. I use All items view without any filtering and users are allowed to read and edit all items. Could you help me what is happening?
Hi Laura, I’m having a problem with a lookup field when I use a SPD 2010 workflow to copy a file from one library to another. The source library has a lookup field from a list that has a date time field as part of the lookup. I wonder if you have come across the issue that I describe below in the notes section.
There are three different SharePoint lists involved in this solution:
1. Schedule lists.
2. Upload libraries.
3. Destination libraries.
1. A calculated field exists for each of the units in the schedule list. This calculated field strings together the following information: event title, date, location. This field is not displayed in any of the views for the schedule. The field consists of an IF statement that checks for the unit name, and displays only the events for a given unit.
2. The upload library employs the lookup field function of SharePoint, and uses the calculated field from the schedule list. There will be a lookup field corresponding to each unit, and the coordinator will select the appropriate one for the file they are wanting to upload to the lecture library.
3. A SharePoint Designer workflow copies the file from the Uploads library and then hides the document from view. This is done instead of deleting the file, in case there is an issue with the copy process.
Notes: The information from the lookup fields copies to the lecture library. There is an issue with the date/time fields. In the process of copying the information, the time of the event is offset by 3 hours.
hello, hello. this saved my job. Thank you, @Laura.
For the issue about: “after the workflow runs, it bounces the user back to the homepage of the site”. Even “Cancel button” redirects you to home page.
I solved it by editing the “WFInitForm.aspx” in SPD.
Go to the line “” and do Ctrl+click at that function. So add location.href = redirectUrl + ‘/Lists/listName/AllItems.aspx’; at the end of the instruction, before the return value.
At just add + ‘/Lists/dntd/AllItems.aspx’ after redirectUrl paramter.
It will became:
Save and test.
Still we have a inconvenient – the page showing list view not automatically reload, but in my opinion is better refresh by pressing F5 than go to home and back again.
can we also copy versions of list item from source to destination list?