cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Twisted_Andy
Level: Powered On

copy list item

I have a Sharepoint List which contains software license information. We already have an entry for Software Title 'X' with licenses located on server 'Y'. Let's call this ID 1 in the List

We have discovered Software Title 'X' also has licenses on Server 'Z'. Let's call this pending new item ID 100. 

 

How can l create a Flow that copies or duplicates Software Title 'X' with licenses located on server 'Y' (ID 1) including all the associated information to create an item for Software Title 'X" on Server 'Z' (ID 100).

Once duplicated, l can go in and edit the different server names accordingly.

 

Essentially l want to take an existing item in a list, and duplicate it in the same list and then edit it.

7 REPLIES 7
Community Support Team
Community Support Team

Re: copy list item

Hi @Twisted_Andy,

 

Could you please show a bit more about your SharePoint list?

 

I have created a SharePoint list and the data structure of it as below:14.JPG

Note: The Server column and License ID column are both Single line of text type column.

 

I have made a test on my side and please take a try with the following workaround:

  • Add a proper trigger, here I use Flow Button trigger.
  • Add a "Get items" action, specify Site Address and List Name.
  • Add a "Filter array" action, From set to output of "Get items" action. Click "Edit in advanced mode", type the following formula:
@and(equals(item()?['Title'], 'X'),equals(item()?['Server'], 'Y'))
  • Add a "Apply to each", input parameter set to output of 'Filter array" action.
  • Within "Apply to each" action, add a "Create item" action, specify Site Address and List Name. Title field set to following formula:
items('Apply_to_each')?['Title']

Server field set to Z, License ID field set to following formula:

items('Apply_to_each')?['License_x0020_ID']

Note: The above 'Title' and 'License ID' property are columns in my SharePoint list. If there is a space within the column name, we should use _x0020_ to instead of the space.

 

Image reference:15.JPG

The flow works successfully as below:16.JPG

 

17.JPG

 

 

Best regards,

Kris

 

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Re: copy list item

Are you using Modern experience in your SharePoint site?

If yes, I would go with creating a flow from the list and then start with the flow template "Complete a custom action for the selected item". Modify it to do the copying of a selected item 🙂

 

With that you can select your X item, invoke the above flow, and voila, you have a copy of the X item!

 

Kind regards, John

Twisted_Andy
Level: Powered On

Re: copy list item

Hi John

Thanks for your response. I understood everything right up to the part where it says "Modify it to do the copying of a selected item".

I have selected "Complete a custom action for the selected item". And get to this point here:

 

 

I assume the "Modify it to do the copying of a selected item" is to modify the Get Item and choose the appropriate action ( or add a new action in between). But, from the list there is no option to copy selected item, only to copy select file which is something different.

Re: copy list item

The "Complete a custom action for the selected item" already has the information about the item that you want to create a copy of. So by modifying the flow, I meant that you just need to create a new item based on the information from the Get item step 🙂

That is all! Kind regards, John

Twisted_Andy
Level: Powered On

Re: copy list item

Hi again John,

Maybe l am daft, but l have the "Complete a custom action for the selected item". In the 'Get Item' i have the 'Site Address' and 'List Name' and the 'Id' of the selected item.

I tried adding a step to 'Create Item' based on the item selected. Again using the same 'Site Address' and 'List Name', and it then shows me all the fields l can apply. Problem is, it is showing up all the columns, and also showing the values of those columns based on what l have set as the default values (as if i was creating a totally new item, as opposed to copying an item with the modified values).

This is my first ever Flow l am creating, so please be patient with me!

A

 

Re: copy list item

In my first reply, I asked if you were using the Modern experience in SharePoint - are you? This is important, as else you cannot use the flow "Complete a custom action for the selected item".

 

When you navigate to your list, can you see this list toolbar and the flow menu?

FlowModernViewListFlowCreate.png

 

It is from here that you can create a flow that is already setup to use this list. When I used Create a flow and chose the "Complete a custom action for the selected item" template, I got this!

FlowForTheSelectedItemDefault.png

 

So all I need to do now, is add a new step that will create a new item and use the values from the Get Item step.

Hope this helps you on the way, kind regards, John

Twisted_Andy
Level: Powered On

Re: copy list item

Hi John

Yes l am using the modern experience in Sharepoint 365 (not the claasic). I got it - thanks to your instructions l got it working.

Thank you very much!!!

A

 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 178 members 6,230 guests
Please welcome our newest community members: