I would like to create a list from custom template already available in the site. I tried following code -

     this.result = SP.ClientContext.get_current().get_site().getCustomListTemplates(SP.ClientContext.get_current().get_web());

function retrieveTemplates_fail() { }           
function retrieveTemplates_success()
    var en = this.result.getEnumerator();
    while (en.moveNext())
        var item = en.get_current();
        if (item.get_name() === 'Template - Review Access')
            var listCreationInfo = new SP.ListCreationInformation();


            function createList_fail() { alert('fail') };
            function createList_success() { alert('success') };

                Function.createDelegate(this, createList_success), 
                Function.createDelegate(this, createList_fail)

    Function.createDelegate(this, retrieveTemplates_success),
    Function.createDelegate(this, retrieveTemplates_fail)

On executing the code I can only create list - Custom list with out the columns available in list template.

Can someone guide whats wrong in the code or provide any new code. Is json code available ?

1 Answer 1


You provided default template for custom list, that's why as a result you are having list without columns.

What you need to is to specify your custom template's type and feature id (you already has it commented):

  • But if you look at site collection settings - list template - you all all list templates with same GUID. So how will to identify the one you need ? Commented Feb 3, 2017 at 12:02
  • Like in your code - you are filtering template by name - if (item.get_name() === 'Template - Review Access') Commented Feb 3, 2017 at 12:04
  • it just get the generic GUID like for list or library or any other type. If you observe in list template page, all the GUIDs are same for particular type of base template. Even i am surprised !!! Commented Feb 3, 2017 at 12:20

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.