Create list templates for your organization in SharePoint Online

 

Does your organization need to have a Microsoft list template available for all the employees?

No alt text provided for this image

In my previous article, we learned how to create a Modern Calendar view from a simple SharePoint Online list. And now, how about saving this custom list as a template and making it available for your whole organization. When users create new lists, they can select from these templates alongside the built-in solutions or they can choose from the templates provided by your organization.

How to create a list template available for your whole organization?

For this purpose first of all is needed to be a Global Administrator or SharePoint Online administrator. We need to run PowerShell as administrator and assure ourselves that the module Microsoft.Online.SharePoint.PowerShell is up to date. The easiest way to do so is by executing the CMDLet:

Update-Module -Name Microsoft.Online.SharePoint.PowerShell

The next steps are to connect to the SPOService and create a variable that will extract the site script output from an existing list. Then we need to add the site script and use the variable as a reference to the content. When we complete the steps successfully we will receive a script ID that will be used in the last step.


Connect-SPOService -Url https://*******-admin.sharepoint.com

$extracted = Get-SPOSiteScriptFromList -ListUrl "https://******.sharepoint.com/sites/GDPR/Lists/Modern Calendar View List/"

Add-SPOSiteScript -Title "Modern Calendar" -Description "This create a modern calendar" -Content $extracted


Id                  : 49eee57f-cbaf-4304-ba7b-*************
Title               : Modern Calendar
Description         : This create a modern calendar
Content             : 
Version             : 0
IsSiteScriptPackage : False

So in our last step, we need to create a list design using the site script ID that was returned from the step above ( 49eee57f-cbaf-4304-************ ). This part is a little tricky because before we continue with the PowerShell command we need to go back to our site and upload the picture that will be used as a thumbnail to the site assets library. When the picture is uploaded we can proceed with the final CMDLet.


Add-SPOListDesign -Title "DEMO Modern List" -Description "This creates a modern calendar" -SiteScripts "49eee57f-cbaf-4304-ba7b-6a9e10b7ed07" -ListColor Red -ListIcon BullseyeTarget -ThumbnailUrl "https://*****.sharepoint.com/sites/GDPR/SiteAssets/demo.png"

And here is the final result, I hope you'll like it :

No alt text provided for this image

The good news here is that when we complete such a procedure we don't simply use the list structure with the already existing columns but we also get all the available views for the list. So for example, if we have a list with a customized view such as our Modern Calendar view, we can have it automatically applied to the new list that we will create by using this template.

Comments