List-Formatting icon indicating copy to clipboard operation
List-Formatting copied to clipboard

Is there a way to exporting JSON configured List from from one site to another

Open astatke opened this issue 3 years ago • 3 comments

Sample (which sample are you talking about)

Anyone of the samples

Question (the more details, the better)

I have a custom SPO list where I applied JSON formatting for the Header, Body and Footer. I would like to treat this as template so that I can export and apply it to another site as opposed to doing it manually. I thought the PnP.PowerShell cmdlet “Get-PnPSiteTemplate” would be able to export the list formatting but to no avail. For your information, I can see column formatting be easily exported as part of my Get-PnPSiteTemplate but not the list form formatting. If there is a way where we can be able to export such Header, Body and Footer custom JSON code and import it to a targeted site list?

astatke avatar Nov 30 '21 23:11 astatke

Did you give a look on the scripts on tool folder in this repo, maybe can help you there https://github.com/pnp/List-Formatting/blob/master/tools/general-dynamic-deployment-with-vscode/powershell/PowerShell/ListFormatting.Deployment.ListView.ps1

aaclage avatar Dec 01 '21 05:12 aaclage

Sample (which sample are you talking about)

Anyone of the samples

Question (the more details, the better)

I have a custom SPO list where I applied JSON formatting for the Header, Body and Footer. I would like to treat this as template so that I can export and apply it to another site as opposed to doing it manually. I thought the PnP.PowerShell cmdlet “Get-PnPSiteTemplate” would be able to export the list formatting but to no avail. For your information, I can see column formatting be easily exported as part of my Get-PnPSiteTemplate but not the list formatting. If there is a way where we can be able to export such Header, Body and Footer custom JSON code and import it to a targeted site list?

@astatke Here you can find and use powershell script just for this specific task: https://pnp.github.io/script-samples/spo-list-formatting/README.html?tabs=pnpps

ValerasNarbutas avatar Dec 15 '21 15:12 ValerasNarbutas

@ValerasNarbutas - Thank you for sharing as this is exactly what I was looking for. I will try to implement using this sample script and report back my findings. @aaclage - Thank you for sharing your resources as well. I found it to be helpful for deploying column and view formatting from site to site.

astatke avatar Dec 15 '21 17:12 astatke

BTW, this code has helped me to do what I was looking for, https://pnp.github.io/script-samples/spo-list-formatting/README.html?tabs=pnpps

astatke avatar Jul 16 '23 20:07 astatke