Modern Sharepoint online - Custom Document Library template

Hamish 90 Reputation points
2023-03-30T13:16:14.88+00:00

Hello,

I had a query on the creation of Document Libraries and custom templates.

Is it possible that I can make a custom template that will have specific columns added into the base library (including one that I created), so that when users of the SharePoint will always have those columns added in when they create a new Document Library.

So for example, currently when I create a new Document Library, the below columns are automatically populated:

Document Library image 1

But would it be possible to have that when I click create a new document library that it automatically creates the new columns as well like in the image below:

Document Library image 2

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,894 questions
{count} votes

Accepted answer
  1. Yanli Jiang - MSFT 22,036 Reputation points Microsoft Vendor
    2023-03-31T07:04:12.1133333+00:00

    Hi @Hamish ,

    You can make it by Save document library as template.

    Go to Library Settings, click Save document library as template under the Permissions and Management section.

    This is the library I used:

    03313

    • If you cannot find it, please Enable Custom Script in SharePoint Online .
      1. Sign in to Office 365 and go to the SharePoint Online Admin Center as an admin.
      2. Click on Settings from the left navigation >> Scroll down to the “Custom Script” section.
      3. Under the Custom Script section, Set “Allow users to run custom script on personal site” and “Allow
        users to run custom script on self-service created sites
        ” options.  03312
      4. Click on “OK” to save your changes.
      This enables custom scripts in SharePoint Online. However, this change may take up to 24 hours to reflect. To enable scripting on a particular site collection immediately, use this PowerShell script through SharePoint Online Management Shell.
       #Variables for Admin Center and Site Collection URL
       $AdminCenterURL = "https://crescent-admin.sharepoint.com/"
       $SiteURL="https://crescent.sharepoint.com/Sites/marketing"
        
       #Connect to SharePoint Online
       Connect-SPOService -url $AdminCenterURL -Credential (Get-Credential)
        
       #Disable DenyAddAndCustomizePages Flag
       Set-SPOSite $SiteURL -DenyAddAndCustomizePages $False
       
    

    Note: The Group-connected Root site’s “Documents” (Shared Documents) library comes with the “Save document library as template” disabled by default, even if the custom scripts are enabled.

    In your case, not select Include Content.

    03315

    Then the template is created successfully.

    03316

    Through New-->app to create a document library use the template:

    03311

    And the new library just like this:

    03317

    NOTES:

    1. Above method does not work on Communication sites or Team sites connected to an Office 365 Group.
    2. You have to be a Site Owner (Full Control) at the site level to perform the above steps.

    For more information, please refer to:

    https://sharepointmaven.com/5-ways-to-store-and-reuse-document-templates-in-sharepoint/

    Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    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.


0 additional answers

Sort by: Most helpful