Forum Discussion
Copy SharePoint List to the another new site
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.
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.
- aconverJan 04, 2022Copper Contributor
It's possible to copy a list and it's content from one SharePoint site to another by creating a template from the original list. The Save as Template dialog includes a check box called 'Include Content'. Checking this box means that all content from the original list can be carried over to the new location.
- 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- NEEdANov 03, 2023Copper Contributor
I tried something like this but when created item, I am having issues with choice field.
I am not sure what to define here. By right it should copy value from the list.
- 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
- Al_B_inPTMar 14, 2021Brass ContributorThanks! I was just being a little tongue in cheek. Obviously Power Automate can do a lot of more stuff than simple Boolean. Thanks for the example! I'll try it out tomorrow !