SOLVED

Get a Sharepoint Site Script from specific site

%3CLINGO-SUB%20id%3D%22lingo-sub-2759700%22%20slang%3D%22en-US%22%3EGet%20a%20Sharepoint%20Site%20Script%20from%20specific%20site%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2759700%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3EI'm%20quite%20new%20to%20the%20topic%20of%20site%20scripts%2C%20but%20as%20far%20as%20I%20understood%20the%20idea%20of%20these%20is%20to%20have%20a%20.json%20specification%20that%20is%20loaded%20onto%20the%20Sharepoint%20and%20then%20can%20be%20used%20as%20template.%20Also%20there%20is%20the%20possiblity%20to%20use%20this%20.json%20directly%20to%20create%20a%20Sharepoint%20site%20via%20Powershell.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENow%20I%20found%20the%20total%20overview%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdeveloper.microsoft.com%2Fjson-schemas%2Fsp%2Fsite-design-script-actions.schema.json%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdeveloper.microsoft.com%2Fjson-schemas%2Fsp%2Fsite-design-script-actions.schema.json%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnd%20the%20Documentation%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsharepoint%2Fdev%2Fdeclarative-customization%2Fsite-design-json-schema%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsharepoint%2Fdev%2Fdeclarative-customization%2Fsite-design-json-schema%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBut%20as%20far%20as%20I%20understood%20there%20is%20no%20possiblity%20to%20get%20this%20.json%20script%20from%20an%20already%20exsiting%20Sharepoint.%20I%20understand%2C%20that%20the%20script%20is%20what%20a%20script%20is%20and%20is%20executed%20in%20the%20order%20the%20actions%20are%20entered%2C%20but%20I%20was%20wondering%20if%20there%20is%20an%20easier%20way%20then%20going%20through%20the%20whole%20sharepoint%20site%20and%20writing%20the%20script%20and%20all%20actions%20one%20by%20one.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20template%20I%20try%20to%20get%20as%20site%20script%20must%20include%20creating%20lists%2C%20with%20specific%20fields%2C%20load%20webparts%20we%20already%20added%20to%20the%20app%20catalog%20and%20set%20the%20properties%20of%20these%20on%20specific%20pages%2C%20create%20a%20sitegroup%20and%20set%20site%20and%20list%20specific%20permissions%20and%20maybe%20load%20data.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20my%20questions%20are%3A%3C%2FP%3E%3CP%3E1.%20Is%20there%20a%20way%20to%20get%20the%20site%20script%20of%20a%20already%20created%20sharepoint%20site%2C%20that%20isn't%20based%20on%20a%20site%20script%3F%3C%2FP%3E%3CP%3E2.%20Is%20it%20possible%20to%20set%20properties%20of%20webparts%20directly%20when%20adding%20them%20on%20a%20site%3F%3C%2FP%3E%3CP%3E3.%20Is%20it%20possible%20to%20already%20set%20up%20a%20new%20sitegroup%20and%20have%20specific%20permission%20levels%20and%20permissions%20per%20site%2Flist%3F%3C%2FP%3E%3CP%3E4.%20Is%20it%20possible%20to%20load%20data%20into%20a%20table%20already%2C%20or%20should%20it%20be%20done%20later%20(the%20data%20varies%20between%20different%20runs%20of%20the%20template)%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20for%20any%20answer%20to%20one%20of%20the%20questions%20and%20I%20hope%20these%20are%20not%20asked%20before%2C%20but%20I%20couldn't%20find%20one%20for%20specificly%20the%20first%20question.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EComment%3A%20I%20know%20that%20there%20is%20the%20possiblity%20to%20get%20the%20site%20script%20of%20the%20sharepoint%20site%2C%20but%20since%20the%20template%20sharepoint%20was%20simply%20created%20with%20the%20default%20empty%20template%2C%20this%20doesn't%20realy%20reduce%20the%20amount%20of%20scripting.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2759808%22%20slang%3D%22en-US%22%3ERe%3A%20Get%20a%20Sharepoint%20Site%20Script%20from%20specific%20site%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2759808%22%20slang%3D%22en-US%22%3EThis%20could%20be%20an%20option%20for%20you%3A%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsharepoint%2Fdev%2Fsolution-guidance%2Fintroducing-the-pnp-provisioning-engine%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsharepoint%2Fdev%2Fsolution-guidance%2Fintroducing-the-pnp-provisioning-engine%3C%2FA%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2759821%22%20slang%3D%22en-US%22%3ERe%3A%20Get%20a%20Sharepoint%20Site%20Script%20from%20specific%20site%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2759821%22%20slang%3D%22en-US%22%3EJust%20cross-read%20it%20and%20this%20sounds%20indeed%20like%20a%20good%20option.%20I%20will%20test%20this%20and%20get%20back%20if%20it%20solved%20my%20issue%2C%20but%20either%20way%20thank%20you%20very%20much.%3C%2FLINGO-BODY%3E
New Contributor

Hi,

I'm quite new to the topic of site scripts, but as far as I understood the idea of these is to have a .json specification that is loaded onto the Sharepoint and then can be used as template. Also there is the possiblity to use this .json directly to create a Sharepoint site via Powershell. 

 

Now I found the total overview: https://developer.microsoft.com/json-schemas/sp/site-design-script-actions.schema.json

 

And the Documentation: https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/site-design-json-schema

 

But as far as I understood there is no possiblity to get this .json script from an already exsiting Sharepoint. I understand, that the script is what a script is and is executed in the order the actions are entered, but I was wondering if there is an easier way then going through the whole sharepoint site and writing the script and all actions one by one. 

 

The template I try to get as site script must include creating lists, with specific fields, load webparts we already added to the app catalog and set the properties of these on specific pages, create a sitegroup and set site and list specific permissions and maybe load data.

 

So my questions are:

1. Is there a way to get the site script of a already created sharepoint site, that isn't based on a site script?

2. Is it possible to set properties of webparts directly when adding them on a site?

3. Is it possible to already set up a new sitegroup and have specific permission levels and permissions per site/list?

4. Is it possible to load data into a table already, or should it be done later (the data varies between different runs of the template)?

 

Thanks for any answer to one of the questions and I hope these are not asked before, but I couldn't find one for specificly the first question.

 

Comment: I know that there is the possiblity to get the site script of the sharepoint site, but since the template sharepoint was simply created with the default empty template, this doesn't realy reduce the amount of scripting.

 

 

2 Replies
best response confirmed by JGeistler (New Contributor)
Just cross-read it and this sounds indeed like a good option. I will test this and get back if it solved my issue, but either way thank you very much.