Forum Discussion
Standard Folder Structure for Organization Template Schema
- Aug 06, 2022
By default Get-SPOSiteScriptFromWeb command will not include folder structure from document library.
For that you need to update Site Design / Script JSON before adding it as Organization Template. There you can provision folder using list sub action called "addFolder".
Official JSON Schema for supported action: https://developer.microsoft.com/json-schemas/sp/site-design-script-actions.schema.jsonI have created sample JSON schema to provision folder inside document library:
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/site-design-script-actions.schema.json", "actions": [ { "verb": "createSPList", "listName": "MyDocuments", "templateType": 101, "subactions": [ { "verb": "setDescription", "description": "List of Customers and Orders" }, { "verb": "addFolder", "path": "Folder1" }, { "verb": "addFolder", "path": "Folder2" }, { "verb": "addFolder", "path": "Folder1/Folder11" } ] } ], "version": 2 }
Hope it will help to you and if it does then request you to mark this as answer or like it.
llambert1110 You can try using Site templates. Site templates can be used each time a new site is created to apply a consistent set of actions. Site templates created using custom site scripts will display in the From your organization tab in the site template gallery.
Check this to get started on site templates - https://support.microsoft.com/en-us/office/apply-and-customize-sharepoint-site-templates-39382463-0e45-4d1b-be27-0e96aeec8398?ui=en-US&rs=en-US&ad=US
- llambert1110Aug 05, 2022Copper ContributorI already have an understanding of the "From you Organization" templates and that is exactly what I'm attempting to create. I've already gone through the steps described but when you run the "Get Script" I listed below, it doesn't give you the folder and subfolder structure in the schema.
I want to have a folder structure created in the document library when someone chooses this template from our organization template gallery.
Get-SPOSiteScriptFromWeb `
-WebUrl https://xxxxxxxx.sharepoint.com/sites/XXXXXXProjectName `
-IncludeBranding `
-IncludeTheme `
-IncludeRegionalSettings `
-IncludeSiteExternalSharingCapability `
-IncludeLinksToExportedItems `
-IncludedLists ("Shared Documents")
{