banner



How To Make A Site Template In Sharepoint 2021

  • Dipen Shah
  • Updated date Sep 22, 2021
  • x.3k
  • 4

In this web log, you lot will learn how to get an existing Site Template and Apply information technology to Be SharePoint Site using Power Automate.

Introduction

Many times, a site is already created, and we need to apply configuration in the existing site to attain some level of consistency. How tin we achieve it?

To reach this kind of implementation, employ site template and site scripts to automate provisioning to the existing modern site or create a new site using site templates which is available in your system tenant.

In the previous blog, I encompass how to create a new site Script and Site Template using Rest API in Power Automate.

I hope, yous have already created the Site Script and Site Design. If you desire to create so you tin click here.

Today we are looking at how developers can become an existing Site Template and Utilise information technology to SharePoint'south existing site using Remainder in Ability Automate.

Learning Objectives

  1. Get Site Template
  2. Filter Site Template by Proper name
  3. Employ Site Template to existing SharePoint Site.

Prerequisite

  1. M365 surround
  2. Power automate admission requires a license
  3. SharePoint Admin Access
  4. Site Template in tenant

Allow'southward get started,

Create Power automate

Go to https://portal.office.com and click on Power automate.

Click on "New Menstruation" and Select "Instant Cloud Flow".

Select "Manually Trigger Menses" and Add Proper noun "Create-Site Template-Flow".

Click on Create Button.

Get Existing Site Template and Apply to Existing SharePoint Site

Get existing Site Template from Tenant

Click on "Add Action".

Select "Send an HTTP request to SharePoint".

Select Site from List.

Select Method "Post".

Add below URL to URI section.

              /_api/Microsoft.SharePoint.Utilities.WebTemplateExtensions.SiteScriptUtility.GetSiteDesigns                          

Click on "Add Action".

Select "Parse JSON".

Add together below JSON to Parse JSON.

              {     "blazon": "object",     "properties": {         "d": {             "type": "object",             "properties": {                 "GetSiteDesigns": {                     "type": "object",                     "properties": {                         "__metadata": {                             "type": "object",                             "properties": {                                 "blazon": {                                     "type": "cord"                                 }                             }                         },                         "results": {                             "type": "array",                             "items": {                                 "type": "object",                                 "properties": {                                     "Clarification": {                                         "type": "cord"                                     },                                     "DesignPackageId": {                                         "type": "string"                                     },                                     "DesignType": {                                         "type": "string"                                     },                                     "IsDefault": {                                         "blazon": "boolean"                                     },                                     "IsOutOfBoxTemplate": {                                         "type": "boolean"                                     },                                     "IsTenantAdminOnly": {                                         "type": "boolean"                                     },                                     "ListColor": {                                         "type": "string"                                     },                                     "ListIcon": {                                         "type": "cord"                                     },                                     "PreviewImageAltText": {},                                     "PreviewImageUrl": {},                                     "RequiresGroupConnected": {                                         "blazon": "boolean"                                     },                                     "RequiresTeamsConnected": {                                         "type": "boolean"                                     },                                     "RequiresYammerConnected": {                                         "blazon": "boolean"                                     },                                     "SiteScriptIds": {                                         "blazon": "object",                                         "properties": {                                             "__metadata": {                                                 "type": "object",                                                 "properties": {                                                     "type": {                                                         "blazon": "string"                                                     }                                                 }                                             },                                             "results": {                                                 "blazon": "array",                                                 "items": {                                                     "type": "string"                                                 }                                             }                                         }                                     },                                     "SupportedWebTemplates": {                                         "type": "object",                                         "properties": {                                             "__metadata": {                                                 "blazon": "object",                                                 "properties": {                                                     "type": {                                                         "type": "string"                                                     }                                                 }                                             },                                             "results": {                                                 "type": "assortment"                                             }                                         }                                     },                                     "TemplateFeatures": {                                         "type": "object",                                         "properties": {                                             "__metadata": {                                                 "type": "object",                                                 "properties": {                                                     "type": {                                                         "type": "cord"                                                     }                                                 }                                             },                                             "results": {                                                 "type": "array"                                             }                                         }                                     },                                     "ThumbnailUrl": {},                                     "Title": {                                         "type": "string"                                     },                                     "WebTemplate": {                                         "blazon": "string"                                     },                                     "Id": {                                         "blazon": "string"                                     },                                     "Order": {},                                     "Version": {                                         "blazon": "integer"                                     }                                 },                                 "required": [                                     "Description",                                     "DesignPackageId",                                     "DesignType",                                     "IsDefault",                                     "IsOutOfBoxTemplate",                                     "IsTenantAdminOnly",                                     "ListColor",                                     "ListIcon",                                     "PreviewImageAltText",                                     "PreviewImageUrl",                                     "RequiresGroupConnected",                                     "RequiresTeamsConnected",                                     "RequiresYammerConnected",                                     "SiteScriptIds",                                     "SupportedWebTemplates",                                     "TemplateFeatures",                                     "ThumbnailUrl",                                     "Title",                                     "WebTemplate",                                     "Id",                                     "Order",                                     "Version"                                 ]                             }                         }                     }                 }             }         }     } }            

Filter Site Template By Name

Select "Condition" from the list of connectors.

Compare Championship to Site Template Proper name. The championship will be returning from Parse JSON activeness.

When y'all select Title from it, It would convert in Foreach loop because Get Site Template returns all site templates from the tenant.

Get Existing Site Template and Apply to Existing SharePoint Site

If Status is "True" then nosotros volition utilize the Site Template to the Existing Site.

Use Site Template to existing SharePoint Site

Click on "Add Action" inside the Truthful Section of Condition.

Select "Ship an HTTP request to SharePoint".

Select Site from the list.

Select Method "Mail service".

Add Beneath URL-to-URL department.

              /_api/Microsoft.SharePoint.Utilities.WebTemplateExtensions.SiteScriptUtility.ApplySiteDesign                          

The header Should be as beneath.

              {   "Content-Type\n": "application/json;charset=utf-eight",   "accept": "awarding/json;odata.metadata=minimal",   "odata-version": "iv.0" }            

The body Should be equally below.

              {  "siteDesignId": "@{items('Apply_to_each')?['Id']}", // ID from existing item in from For each loop  "webUrl":"https://dev1802.sharepoint.com/sites/Demo3" // Site where you want to employ site template }            

Full Flow would be like every bit beneath.

Get Existing Site Template and Apply to Existing SharePoint Site

How To Make A Site Template In Sharepoint 2021,

Source: https://www.c-sharpcorner.com/blogs/get-existing-site-template-and-apply-to-existing-sharepoint-site

Posted by: caponecestion.blogspot.com

0 Response to "How To Make A Site Template In Sharepoint 2021"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel