I'm trying to use the SharePoint 2013 JavaScript Object Model to retrieve a List via an internal name equivalent.

SPList doesn't have a Name or Internal Name property. It is referred to by the Title; however in my case the Title has been altered.

For example the current Title is 'My Images' however, the list URL is '/Lists/MyImages'

I've been browsing the SPList properties using SharePoint Manager 2013 and I've found a couple of properties that might help:

  • EntityTypeName (MSDN)
  • RootFolder (MSDN)

Both of these properties are giving me the internal name ('MyImages') but I don't know anything about these properties and which property I should use (if either of them)

Can someone give me some info on these properties and what they are based on? The MSDN pages don't give me enough information to work with

  • 1
    why don't you access the list via GUID?
    – Gwny
    Commented Aug 4, 2014 at 9:53

4 Answers 4


If you don't want to use the GUID, you'll have to make an extra call and get the vti_listname property from the list folder. The folder you can get by url using the getFolderByServerRelativeUrl on the SP.Web object.


var clientContext = SP.ClientContext.get_current();

var web = clientContext.get_web();
var folder =  web.getFolderByServerRelativeUrl(String.format('{0}/lists/MyImages',_spPageContextInfo.webServerRelativeUrl));

clientContext.load(folder, "Properties");

clientContext.executeQueryAsync(function () {

    var list = web.get_lists().getById(folder.get_properties().get_item("vti_listname"));
    clientContext.executeQueryAsync(function () {


    },function(sender, args) {
        console.log("Fail: " + args.get_message());

}, function(sender, args) {
    console.log("Fail: " + args.get_message());
  • I'm trying this code but the first clientContext.executeQueryAsync (loading folder properties) is giving me an exception - I enter the outer fail function Commented Feb 16, 2015 at 2:11
  • @jasonscript check if you are using the corret url: String.format('{0}/lists/MyImages',_spPageContextInfo.webServerRelativeUrl); Commented Feb 16, 2015 at 6:00

Like to note that RootFolder as you point out yourself is not a bad idea if you were to use REST (and not jsom), like this:

/_api/Web/Lists?$filter=RootFolder/Name eq 'MyImages'

Then just pick the first one, and you get one result with all additional list data. (Syntax tested on 365, might need $expand on-premise.)


How to get List by its Url:

function getListByName(name,success,error)
   var ctx = SP.ClientContext.get_current();
   var lists = ctx.get_web().get_lists();
   var result = ctx.loadQuery(lists, 'Include(RootFolder)');

     function () {
       var list;  
       for(var i = 0; i < result.length; i++) {
           if(result[i].get_rootFolder().get_name() == name) {
               list = result[i];

Key points:

  • requires only a single request to the server
  • compatible with SharePoint 2010/2013 JSOM


    function(list) {
            console.log('List has been found');
    function(sender, args) {
  • Great! But, I'm still curious about the property EntityTypeName, is it a safe way to rely on while getting a list? Commented Feb 23, 2016 at 8:56
  • Be aware that you will need extra permissions to get rootfolder of lists, that's why personally i prefer Anders Aune's solution
    – Verthosa
    Commented May 4, 2016 at 9:25

You can use Getlist method of the Web object MSDN Link.

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.