Skip to main content

Posts

Showing posts with the label SiteTemplate

SharePoint Site Script & Site Design

  H ope you are doing fine and safe in this pandemic situation. I recently came up with an opportunity to work with SharePoint Site Designs. SharePoint Site templates are now replaced with Site designs in Modern Sites.   SharePoint allows us to create JSON schema to apply our custom options that we want to add. Below are the things we can apply using site script. Create a new SharePoint list Define a new site column Define a new content type Add a navigation link Remove a navigation link Apply a theme Set branding properties Set a site logo Join a hub site Install an add-in or solution Register an extension Activate a Feature Trigger a flow Configure regional settings Add users (principals) to SharePoint Groups Manage guest access Let us assume we have a JSON schema created. I am taking below sample from MS documentation for reference.   We will now be adding above JSON schema to SharePoint as Site Script. Below is the command we execute. $site_script = ‘{   "$schema"

Site Design Tasks, Power Automate and Modern Sites

S harePoint Site templates are now replaced with Site designs in Modern Sites. We can create custom site designs using some json script(s). Site Design allows to create lists, create list views, apply theme, customize navigation, create content types, create site columns and so on. Click here to see JSON scheme reference for creating custom site design.  Endpoint to apply site design as a part of flow is as below. _api/Microsoft.Sharepoint.Utilities.WebTemplateExtensions.SiteScriptUtility.AddSiteDesignTaskToCurrentWeb We must use “Send Http Request to SharePoint” action to make an API call to SharePoint. SiteDesignId must be part if body, this is GUID of the SharePoint site design you need to apply. We can line up sequence of calls if we need to apply multiple site designs to a single site. We can now wait for few mins and all our sited designs will get applied or we can also check the status by making another API call with below endpoint. You just need to pass the Apply Design ta