Site designs & scripts

Site designs and site scripts can be used to automate provisioning new or existing modern SharePoint sites that use your own custom configurations. A JSON format template is used for provisioning, see https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/site-design-overview for more information. This method makes site provisioning rather easy, especially with the Make interface. However, the options are limited. If small changes, like an additional document library are sufficient, this provisioning method can be very handy.

Site designs consist of one or multiple site scripts. We begin explaining the site scripts and additionally we will explain the creation of a site design.

Site scripts

Site scripts are JSON files that specify an ordered list of actions to run when creating the new site. The actions are run in the order listed. Each action in a site script is specified by a verb value in the JSON. A list of available actions and their parameters can be found here: https://docs.microsoft.com/nl-nl/sharepoint/dev/declarative-customization/site-design-json-schema.

Click on ‘Site scripts’ to open up the Site script creation interface (figure 9). Click on ‘Create’ to create a new Site script or use the dropdown menu to select and edit an existing site script. Use the Save and Delete buttons to either Save a new version of the site script or delete it.

Figure 10: Site scripts

Figure 10: Site scripts

ID

The ID is a generated GUID. No need to edit this. This is just for informational purposes displayed.

Title

Define a Title for the site script. Choose a fitting title for the actions the site script performs.

Description

The description can be used to supply additional information.

Version

The new version number of the site script. Choose 1 if this is the first version of your script.

Content

Here we define the actions and sub actions in a site script. Make sure the JSON is valid. Use this structure:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
{
  "$schema": "schema.json",
  "actions": [
    ...
    <one or more verb actions>
    ...
  ],
  "bindata": { },
  "version": 1
}

 

Site designs

A site design is a combination of these site scripts, of these lists of actions. A site design can be used in site provisioning. When creating a site using the SharePoint UI a Site design can be chosen (figure 10).

Choose a site design

Click on ‘Site design’ and use the ‘Create’ button to create a new site design or use the dropdown menu to alter and existing site design. A form appears to fill in (figure 11).

Figure 11: Site designs

Figure 11: Site designs

ID

The ID is a generated GUID. No need to edit this. This is just for informational purposes displayed.

Title

Choose a fitting title for the site design.

Description

The description can be used to supply additional information.

Webtemplate

Choose which type of site you would like this site design to work on. Team Site (modern) or Communication Site.

Preview image url (optional)

The URL of a preview image. If none is specified, SharePoint uses a generic image.

Preview image alt text (optional)

The alt text description of the image for accessibility.

Default

Choose this option if you would like the site design to be applied every time a communication or a Team Site is created.

Permissions

Site designs are available to everyone by default. You can also scope site designs so that they are only available to specific users or groups.

Site scripts

The site scripts you would like to perform when using this site design. Drag-and-drop site designs from the right side of the screen under ‘Available scripts’, which have been created previously in the Site script form, into this box. Drag them up and down to alter the order of these scripts.