How To Create A List Template In Sharepoint
-
- Updated date Mar 18, 2021
- 18.3k
- 5
On this blog, here I am going to draw nearly how we tin save a list as a template in SharePoint online using Ability Shell.
Introduction
In SharePoint, the list templates provide re-usability of columns without recreating it on every single site. For e.one thousand. I have created a custom list which name is Project, in a SharePoint site collection with all relevant columns, At present I want this list structure in other site collections, without recreating the listing on every single site.
Steps to save a list or library as a template
Step-1
Go to a SharePoint list, then navigate to list settings nowadays nether the listing tab on the ribbon and then click on Listing Settings.
Step-ii
Click on Salvage list as Template nether Permissions and Management group.
Step-3
Provide template Filename and Template proper noun. If you want to include the content, then select the check box, Click Ok
Footstep-iv
Click OK on the success page.
How to download the list template
Step 1
Go to site setting, Click on Listing Templates under web Designers and Gallery.
Pace 2
Click on Upload Document on the Files tab, then browse your file i.e-Demo.end
Y'all can also save the list template to your site past using PowerShell script,
- endeavor {
- Add - Type - Path"..\Microsoft.SharePoint.Client.dll"
- Add - Blazon - Path"..\Microsoft.SharePoint.Customer.Runtime.dll"
- $SiteUrl = Read - Host"Enter the SiteUrl"
- $UserName = Read - Host"Enter the username"
- $Countersign = Read - Host - AsSecureString Password
- $ctx = New - Object Microsoft.SharePoint.Client.ClientContext($siteUrl)
- $Credentials = New - Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($UserName, $Password)
- $ctx.Credentials = $credentials
- $Web = $Ctx.Web
- $site = $Ctx.Site
- $ctx.Load($web)
- $ctx.Load($site)
- $ctx.ExecuteQuery()
- $ListName = Read - Host"Enter the List Proper noun"
- $list = $Ctx.Web.lists.GetByTitle($ListName)
- $FileName = Read - Host"Enter the File Proper noun"
- $TemplateName = Read - Host"Enter the Template Name"
- $listing.SaveAsTemplate($FileName, $TemplateName,"list template description" , $ true )
- $ctx.ExecuteQuery()
- Write - Host - ForegroundColor Green"Successfully save the listing Template."
- sleep x
- }catch {
- Write - Host - ForegroundColor Crimson'Mistake ' , ':'
- $Mistake[0].ToString();
- sleep 10
- }
Follow the below screenshot and enter the values into the parameters appropriately. Then you can get a successful bulletin.
How to upload list template to another site
stride 1
Get to site setting, Click on List Templates under spider web Designers and Gallery.
Pace 2
Click on Upload Document in the Files tab, Then browse your file i.e-Demo.stp
Stride three
Save the list template.
Step 4
Become to Site contents, Click on New then select App.
Pace 5
Select your template.
Step 6
Provide a list Name.
Step 7
At present your list added to the site successfully.
You can besides add the list template to your site by using PowerShell script,
- try {
- Add together - Blazon - Path"..\Microsoft.SharePoint.Customer.dll"
- Add - Type - Path"..\Microsoft.SharePoint.Client.Runtime.dll"
- $SiteUrl = Read - Host"Enter the SiteUrl"
- $UserName = Read - Host"Enter the username"
- $Password = Read - Host - AsSecureString Countersign
- $ctx = New - Object Microsoft.SharePoint.Client.ClientContext($siteUrl)
- $Credentials = New - Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($UserName, $Countersign)
- $ctx.Credentials = $credentials
- $Spider web = $ctx.Web
- $site = $ctx.Site
- $ctx.Load($spider web)
- $ctx.Load($site)
- $ctx.ExecuteQuery()
- $Template = $site.GetCustomListTemplates($Spider web)
- $Lists = $ctx.Web.Lists
- $ctx.Load($Lists)
- $ctx.Load($Template)
- $ctx.ExecuteQuery()
- $TemplateName = Read - Host"Enter the Template Name"
- $ListName = Read - Host"Enter the List Name"
- $ListTemplate = $Template | where {
- $_.Name - eq $TemplateName
- }
- $Listing = $Lists | where {
- $_.Title - eq $ListName
- }
- If($List - eq $Null) {
- $ListCreation = New - Object Microsoft.SharePoint.Client.ListCreationInformation
- $ListCreation.Title = $ListName
- $ListCreation.ListTemplate = $ListTemplate
- $List = $Lists.Add together($ListCreation)
- $ctx.ExecuteQuery()
- }
- Write - Host - ForegroundColor Green"Successfully Add the list."
- sleep 10
- }catch {
- Write - Host - ForegroundColor Red'Error ' , ':'
- $Error[0].ToString();
- sleep ten
- }
Follow the below screenshot and enter the values for the parameters accordingly. And then y'all tin get a successful message.
How To Create A List Template In Sharepoint,
Source: https://www.c-sharpcorner.com/blogs/save-a-list-as-template-in-sharepoint-online-using-powershell
Posted by: wardsleve2000.blogspot.com
0 Response to "How To Create A List Template In Sharepoint"
Post a Comment