Forum Discussion

WYellow's avatar
WYellow
Brass Contributor
Apr 03, 2023

Template SharePoint Library?

Is it possible to create a template document library? Which when a new SharePoint site (or MS Teams) is created it uses that template document library? 

 

E.g., the template document library has defined views and columns, e.g., status (draft, published, archived, obsolete).

 

If so is there any documentation on how to implement this?

3 Replies

  • lsittler's avatar
    lsittler
    Brass Contributor

    Hi WYellow,

     

    Here, it seems the same subject as yours with a Microsoft answer: https://answers.microsoft.com/en-us/msoffice/forum/all/how-can-i-create-a-document-library-template-in/6aef9586-3bdd-4f65-a9e6-5e488b82b73e

     

    The conclusion is: currently, no easy way - to create a Template by script or automation.
    - https://pnp.github.io/powershell/: extract existing library as Template (XML) and import it to another site

    - https://pnp.github.io/cli-microsoft365: script the configuration of your library

    - Power Automate / Logic App: you can use REST API to create or use an existing library and apply all settings

     

    Hoping this information will help you 🙂

    • ObiquitechAdmin's avatar
      ObiquitechAdmin
      Copper Contributor

      lsittler Good conclusion, I found it helpful to pour through those resources in the effort to do the same thing as OP. I think your previous link to 


      https://answers.microsoft.com/en-us/msoffice/forum/all/how-can-i-create-a-document-library-template-in/6aef9586-3bdd-4f65-a9e6-5e488b82b73e

      is not relevant to this thread as there is one response from a Microsoft Agent and they essentially answer a different question, which is "How do I create a document template to upload to my library?" as opposed to the question here which relates to creating an entire document library template.

       

      I have not finished my attempt at making my own document library template so will update answer if/when I find the solution and steps, but for now, here are some useful links I've gathered:
      https://www.sharepointdiary.com/2021/05/sharepoint-online-copy-columns-from-one-list-to-another-using-powershell.html 

      https://www.youtube.com/watch?v=78HS1Vzm2vc&ab_channel=KeaPointTechTips 

      https://laurakokkarinen.com/the-ultimate-guide-to-sharepoint-site-designs-and-site-scripts/ 

  • Andrew Brewster's avatar
    Andrew Brewster
    Copper Contributor

    Its the sort of thing that you could define in a site script that gets run whenever as new site is created.
    https://learn.microsoft.com/en-us/sharepoint/dev/declarative-customization/site-design-overview
    Site owners can also define a template, depending on their permissions (probably need to be site collection admins)
    https://support.microsoft.com/en-us/office/set-a-custom-template-for-a-sharepoint-library-8e0177eb-46bd-4346-9998-330c32733c25
    This seems like a pretty comprehensive guide

    https://laurakokkarinen.com/the-ultimate-guide-to-sharepoint-site-designs-and-site-scripts/

Resources