Forum Discussion
Ronan Dowling
Jan 16, 2020Copper Contributor
Modern Sharepoint Site Design - Doc Library Creation with Links!
Hi Folks, I've created a basic Json Script which binds a Modern Site to a HUB. It also adds about seven doc libraries to the site. My issue is I would like these doc libraries to be navigable fro...
PittSharePointPro
Jan 27, 2023Iron Contributor
"The boss want's to dictate the folder (library / folder) Structure..."
Is there a 'verb' to add folders to a doc library list? If so, what is it? I don't see it listed but might be missing a naming convention here. -- https://learn.microsoft.com/en-us/sharepoint/dev/declarative-customization/site-design-json-schema
Is there a 'verb' to add folders to a doc library list? If so, what is it? I don't see it listed but might be missing a naming convention here. -- https://learn.microsoft.com/en-us/sharepoint/dev/declarative-customization/site-design-json-schema
- GinajCodeNinjaAug 08, 2023Copper Contributor
PittSharePointPro I know this is three years later - but for anyone searching for help....
Adding a folder can now be completed in the subactions segment of a actions set."$schema": "http://json-schema.org/draft-07/schema#","actions": [{"verb": "createSPList","listName": "23","templateType": 101,"addNavLink": true,"subactions": [{"verb": "setTitle","title": "23 Sales or Leasing"},{"verb": "addFolder","path": "Disclosure Statement"},{"verb": "addFolder","path": "Prices & Tracker"}]}...
Note: The "Set Title" is handy to use to keep the URL length of the library name shorter, while still going and renaming the library to the way you want the library to be actually named. This avoids having any %20's in the url, or adding a library name that is too long.
Thanks and happy scripting!
GinjaCodeNinja