Forum Discussion
Copy SharePoint List to the another new site
Al_B_inPT after you have created the structure of the new list from the previous one you can copy all the items into the new list with a flow in Power Automate, then delete the old list.
Rob
Los Gallardos
Microsoft Power Automate Community Super User
RobElliottthanks Rob. While I appreciate that there *is* a way to do it, however convoluted, it would be so much simpler to have a "move" function built into the List product. It's all stored in SP, I assume.
I don't usually go looking in PowerAutomate because that is more "sold' to us as a boolean logic trigger mechanism of if then statements. I took a peek before I posted the OP, but didn't see anything that jumped out at me from a cursory search.
Thanks again. I'll try it out at some point soon.
- RobElliottMar 14, 2021Silver Contributor
Al_B_inPT "boolean logic trigger mechanism of if then statements" : streuth, that's wide of the mark, it's so much more than that. A simple example of the flow is shown below:
Rob
Los Gallardos
Microsoft Power Automate Community Super User- avii1300Jul 19, 2021Copper Contributor
I created the flow that you detailed, however, although my lists has multiple columns, only the Title options shows under the Create Item flow. Is there any way to resolve this? RobElliott
- RobElliottJul 20, 2021Silver Contributoryou'd need to give screenshots of your flow and the SharePoint lists before we could answer that.
- David2480Jun 14, 2021Copper Contributor
- RobElliottJun 15, 2021Silver Contributor
David2480 in this example we're just going to copy the first item in our list, Abla, from the list Almeria L3 to the list called Almeria L4. It has an attachment:
In the flow, the get items action returns a maximum of 100 items by default, so if you are goimng to have more than this you need to go into settings for the get items, switch on the Pagination toggle and set it to the number you need or higher. As I'm only interested on this occasion with 1 item I've added a filter query:
Add an apply to each then add a condition to check wither the item has attachments or not, so the condition is HasAttachments is equal to true
If the item doesn't have attachments you can just add the create item action into the red if no channel:
But if the item has attachments, in the green if yes channel and a get attachments action
Next, add a get attachment content action - it will wrap itself in another apply to each.
Still inside this second apply to each add the create item action. Finally add an add attachment action
The result is as folllows:
Hope that helps.
Rob
Los Gallardos
Microsoft Power Automate Community Super User
- Anthony_VersinoMay 27, 2021Copper Contributor
Thanks this was quite helpful and easy to implement.
Created new list from existing to maintain the structure.
Then created the Flow exactly as you indicated to copy the content.
One issue I ran into was a particular field was of type person, and allowed multiple people to be added. This was causing the flow to add a second "For Each" loop which was failing on run. I didn't spend the time to debug as it wasn't the most important field to capture, I just removed it from the transfer.
Thank you for the comment.
Anthony