Introduction
In this article, you will see how to create a site design and site script for SharePoint Online Modern Team site. In each organization, there might be a requirement where when a new site is created custom branding, custom list or columns or site columns need to be created as soon as the site has been provisioned. In order to automate this process, Microsoft has introduced Site Design and site script where custom configurations can be applied while provisioning the site.
Site design is basically a template which will be selected while creating the site and it takes care of executing the custom configurations (actions) mentioned in the site scripts. Site Design can be applied to even existing templates which are available by default.
Site scripts are JSON file which contains the ordered list of actions that need to be executed. Latest Schema can be referred from this location.
Site designs can be created and registered to group connect modern Team site and communication site and group less team site. This can also be applied to an existing site collection.
In this article, you will see how to create a site design which creates a custom list including few fields.
Create a site script
Open Notepad and copy the below JSON. Save the file as site-script.json. This JSON contains the action to create a list and adding fields to the list. Refer to this schema for more information.
- {
- "$schema": "https://developer.microsoft.com/json-schemas/sp/site-design-script-actions.schema.json",
- "actions": [
- {
- "verb": "createSPList",
- "listName": "VJ Custom List",
- "templateType": 100,
- "subactions": [
- {
- "verb": "SetDescription",
- "description": "VJ Custom List created through Site Design"
- },
- {
- "verb": "addSPField",
- "fieldType": "Text",
- "displayName": "Text Column",
- "isRequired": false,
- "addToDefaultView": true
- },
- {
- "verb": "addSPField",
- "fieldType": "Number",
- "displayName": "Number Column",
- "addToDefaultView": true,
- "isRequired": true
- },
- {
- "verb": "addSPField",
- "fieldType": "User",
- "displayName": "User Column",
- "addToDefaultView": true,
- "isRequired": true
- },
- {
- "verb": "addSPField",
- "fieldType": "Note",
- "displayName": "Note Column Notes",
- "isRequired": false
- }
- ]
- }
- ],
- "version": 1
- }





Venkat GarikapatiPosted Jul 2, 2020, 7:02 PM
Can we get json schema from a existing sharepoint site?
Happy MakkarPosted Apr 2, 2020, 2:02 AM
Is it mandatory to connect with admin center using Connect SPOservice -url http://abc-admin.sharepoint.com before adding site design to specific site.