I searched everywhere, but could not find a solution that worked for me.

We've created a default document library, changed it a bit and saved it as a new document library template from the user interface. I can create document libraries based on this template successfully.

However, I have some CSOM code that creates a library automatically for me. It is now based on the template "101", which is the default document library. I want to create the library in code based on my custom document library.

I understood that I need a custom list template ID (which should be > 10000), but I cannot find out how I can find the custom list template id's. I found commands that list the default list template id's (i.e. 100, 101) but not the custom list template ID's. How can I find the custom list template ID's?

3 Answers 3


How to identify a SharePoint List Template ID (in Browser)

  1. The global variable g_wsaListTemplateId is available on the client side when the List is rendered

    Navigate to List - Press F12 to launch Dev Tools (details) and switch to Console window and run:


    enter image description here

  2. Export List Schema
    Construct the following query to export List Schema:


    where {ListGuid} corresponds to the List Guid

    To find out List Guid go to List - List Settings and copy List Guid from URL as demonstrated below

    enter image description here

    In the generated List Schema find the attribute named ServerTemplate that corresponds to List Template ID

  • Sorry, but I really don't understand your answer. What is console.log? Which List Guid are you talking about? Commented Jan 29, 2014 at 13:40
  • 1
    Martijn, the answer has been updated, hope it's more clear now Commented Jan 29, 2014 at 14:41
  • Thanks. I tried both procedures. In both cases it returns 101, which is the id of the default document library and not the one with the content that I created. Commented Jan 29, 2014 at 16:05

Try this:

  1. Save the list template file (.stp) locally
  2. Change the extension to .zip and extract it
  3. Open manifest.xml and check TemplateID number
  4. Try by use this TemplateID in your code to create a list in a site that contains your custom list template
  • In my case that is "7", I thougt it should be greater that 10000: <TemplateID>7</TemplateID> <Configuration>0</Configuration> <FeatureId>{00BFEA71-E717-4E80-AA17-D0C71B360101}</FeatureId> <TemplateType>101</TemplateType> Commented Jan 29, 2014 at 10:28
  • I saved one in my VM and I got 111000 for TemplateID. Try it with 7 in your code anyway. Commented Jan 29, 2014 at 10:46
  • I did. It still gives me "Invalid List Template ID". Code snippet: ListCreationInformation lci = new ListCreationInformation(); lci.Title = name; lci.TemplateType = libraryType; Where libraryType was 101 and is now 7 Commented Jan 29, 2014 at 11:00

Did you try to select all custom document templates programmatically? Look at the code example below

 var templates = SPContext.Current.Web.ListTemplates.OfType<SPListTemplate>().Where(t => t.IsCustomTemplate).Select(t => t.DocumentTemplate);

Here you can find how you can deal with it through client side object model

  • 1
    I am working client side, so I cannot use the SPContext class. Commented Jan 29, 2014 at 11:03
  • What about this link - learningsharepoint.com/2012/06/19/…. The same but from the client side...
    – Michael
    Commented Jan 29, 2014 at 11:14
  • Sorry. Tried that. Doesn't even give me an error message. :( Commented Jan 29, 2014 at 11:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.