Creating the site script

Once you've identified your actions (such as creating lists, applying themes, or by using the preceding example of Flow), you can assemble them into a site script.

The following site design script does three things:

  • Disables external sharing
  • Creates a custom list called "Customer Contact List"
  • Triggers the Microsoft Flow function we created previously

Let's take a look at this script:

{
"$schema": "schema.json",
"actions": [
{
"verb": "setSiteExternalSharingCapability",
"capability" : "Disabled"
},
{
"verb": "createSPList",
"listName": "Customers",
"templateType": 100,
"subactions": [
{
"verb": "SetDescription",
"description": "Customer Contact List"
},
{
"verb": "addSPField",
"fieldType": "Text",
"displayName": "Customer Name",
"isRequired": false,
"addToDefaultView": true
},
{
"verb": "addSPField",
"fieldType": "Text",
"displayName": "Contact Name",
"isRequired": true,
"addToDefaultView": true
},
{
"verb": "addSPField",
"fieldType": "Text",
"displayName": "Email Address",
"addToDefaultView": true,
"isRequired": true
},
{
"verb": "addSPField",
"fieldType": "Text",
"displayName": "Phone Number",
"addToDefaultView": true,
"isRequired": true
},
{
"verb": "addSPField",
"fieldType": "Note",
"displayName": "Customer Notes",
"isRequired": false,
"addToDefaultView":false
}
]
},
{
"verb": "triggerFlow",
"url": "https://prod-57.westus.logic.azure.com:443/workflows/a0883dfee5744ddda9295bd838df2e59/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=JKDw5xb6TlwbxPryCcRccr8nKiubZ4t_YavRyydMWEE",
"name": "Post to Teams",
"parameters":
{
"event": "Microsoft Event",
"product": "SharePoint"
}
}
],
"bindata": { },
"version": 1
}
You can use any of the verbs in the JSON schema reference information, which can be found at https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/site-design-json-schema

Additionally, you can find more ideas at https://docs.microsoft.com/en-us/sharepoint/branding-sharepoint-online-sites-modern-experience.

The JSON script is formatted and saved as a text file (typically ending in .json, but you can use any extension you like) so that it can be incorporated into the site design, which we'll cover next.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.143.228.40