questions about site script

逸清 萧 1 Reputation point
2022-07-01T02:19:44.543+00:00

I am learning site design (site template)/site script and am stuck on some questions. General I will get a default site script from a manually created list:

And the script JSON will be like this:

216772-20220701101407.png

How can I get this id? if I want to apply this script to another tenant, will it work? basically, my goal is to store this script as a template and provide some cmdlets to my customer so that he can easily create the same site/list.

thanks

216761-sitescripttempsub.txt

SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
2,267 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,964 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Tong Zhang_MSFT 9,136 Reputation points
    2022-07-01T10:03:25.857+00:00

    Hi @逸清 萧 ,

    According to my research and testing, the ID is an optional attribute. If provided, specifies the id of the field. It needs to be a unique, randomly generated GUID. You can refer to this article:
    https://learn.microsoft.com/en-us/sharepoint/dev/declarative-customization/site-design-json-schema#json-values-1

    If you want to apply this script to another site, you can use Add-SPOSiteScript and Add-SPOSiteDesign.

    For reference:
    https://learn.microsoft.com/en-us/sharepoint/dev/declarative-customization/get-started-create-site-design#add-the-site-script


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.