SOLVED

Sharepoint online - copying List

Copper Contributor

Hi,

I am new to Sharepoint, created a sharepoint list which i am using for Powerapps, is there a way i can create a copy of this list, some thing like save as?

Also, how do i export the list schema from one site to another, ex: dev to test?

 

Thanks

Jeevan

8 Replies
If you mean to copy with the content, there is not way if you are thinking on creating exactly the same list with the data stored in other sites. What you can do is "export" list definition to a PnP Template or to a Site Script so you can re-use when you need...and to export the contents and import to another list write a PS script / piece of code that allow you to do it

Hi @Juan Carlos González Martín ,

I don't need the data from that list, basically , i am using the list as Data source for my Canvas based powerapps, so the list is in Dev environment, now i need to move that list definition to another site(Test/Prod), so users can test my power app. what are my options?

I have got below documentation from MS, which command do i need to use to export the definition so i can reuse.

https://docs.microsoft.com/en-us/powershell/sharepoint/sharepoint-pnp/sharepoint-pnp-cmdlets?view=sh... 

Hi @jk264 

 

In SharePoint, you can save a list as template and create a new list from that template.

 

You can find more details here - Manage list templates

 

 

 

best response confirmed by jk264 (Copper Contributor)
Solution
That way of saving list templates (lest's call it "classic") should be avoided and use PnP and Site Scripts instead. The command you need to make an export of you list is the following one: https://docs.microsoft.com/en-us/powershell/module/sharepoint-pnp/get-pnpprovisioningtemplate?view=s...
To do the same with site scripts take a look at the following article...there you will find how to extrat the site script from a list and create a site design based on that site script: https://drewmadelung.com/powershell-for-sharepoint-site-designs-site-scripts/

Hi @Juan Carlos González Martín 

 

Can I ask why it should be avoided? What's the disadvantages of saving list templates? And the benefits of using PnP and Site Scripts?

 

 

Sure:
(1) Saving a list as template using the classic approach generates a STP file...the approach can be valid, but it's not recommended by Microsoft. Consider it as a deprecated feature
(2) PnP + Site Scripts is the recommended way (by Microsoft) to go to extend a SPO Site with new Columns, Content Types, Lists and Document Libraries

Thanks @Juan Carlos González Martín.

 

It's really helpful.

1 best response

Accepted Solutions
best response confirmed by jk264 (Copper Contributor)
Solution
That way of saving list templates (lest's call it "classic") should be avoided and use PnP and Site Scripts instead. The command you need to make an export of you list is the following one: https://docs.microsoft.com/en-us/powershell/module/sharepoint-pnp/get-pnpprovisioningtemplate?view=s...
To do the same with site scripts take a look at the following article...there you will find how to extrat the site script from a list and create a site design based on that site script: https://drewmadelung.com/powershell-for-sharepoint-site-designs-site-scripts/

View solution in original post