question

SHUOH-8693 avatar image
0 Votes"
SHUOH-8693 asked MichaelHan-MSFT edited

Regarding Github SharePoint Online Sample

Hi there,

I found out a article and sample for SharePoint Online (https://github.com/pnp/List-Formatting/tree/master/view-samples/document-library). It is a better sample for me.

I went through the article and found out a question:

Site Script

This sample includes a site script (update-documents.json) that creates the required site columns, the Document Library, and a new view named All Documents - customized in the Document Library that contains all the required columns.

I use the following command and cannot find something different:

Add-SPOSiteDesign -Title "Document Library Sample" -WebTemplate "64" -SiteScripts "2756067f-d818-4933-a514-2a2b2c50fb06" -Description "Creates customer list and applies standard theme"

cannot find this: "that creates the required site columns, the Document Library, and a new view named All Documents - customized in the Document Library that contains all the required columns."

116669-untitled.png

Does anyone have any idea on it. ?? thanks


office-sharepoint-onlinesharepoint-dev
untitled.png (83.4 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

MichaelHan-MSFT avatar image
0 Votes"
MichaelHan-MSFT answered MichaelHan-MSFT commented

Hi @SHUOH-8693,

After you create the site design, you need to apply the design to your site with the command:

 Invoke-SPOSiteDesign -Identity <id of siteDesign> -WebUrl "https://tenant.sharepoint.com/sites/yoursite"

116888-image.png


If an Answer is helpful, please click "Accept Answer" and upvote it.
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.



image.png (131.6 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @MichaelHan-MSFT,

Another thing is how to get the GUID of SiteScript (67059275-6849-....)??

Thanks

0 Votes 0 ·

Hi @SHUOH-8693,
When we add the siteScript with the below command, the siteScript id will return.

 Get-content 'C:\update-documents.json' -Raw | Add-SPOSiteScript -Title "update documents"


116876-image.png

And we could use Get-SPOSiteScript to list the site script:

116817-image.png


0 Votes 0 ·
image.png (28.7 KiB)
image.png (28.3 KiB)