Share via


how to get internal name of a list

Question

Wednesday, October 9, 2013 1:41 PM

I have created a list say "mylist" after that i went to list properties and changed like "my list". Although the list display title is changed the actual name i.e "mylist" remains the same. How to get that name programatically in client object model such as java script.

Please let me know many thanks in advance.

Regards,

Chaitanya.

All replies (3)

Wednesday, October 9, 2013 3:37 PM ✅Answered

Hi,

To the best of my knowledge a list object does not have internal name.

A list has a Title and ID (which is a GUID). I assume you mean the folder name under .../lists/mylist ?

You can get this by getting the SPList.RootFolder.Name in server side code,

In CSOM it would require to load the list and request the "root folder" property, load the root folder and request the "name" property. very expensive.

In javascript I would recommend you try REST instead, or use CSOM to load lists with their "defaultViewUrl" property, which can get you all lists in the site including their default view URL and parse the default view URL of each list

- the folder name will be ...site url.../lists/listfoldername/forms/xxx.aspx so if you know your site url you can easily parse the string and get the folder name.

This will get you the best performance and minimum server requests.

Good luck.

Regards, Shai Petel.

SharePoint MVP, visit us at http://www.kwizcom.com


Wednesday, October 9, 2013 8:52 PM

An easy way, but a bit of a hack, to get the internal name is to going to the List Settings and click on the column name you are looking for.  The URL will show the internal name at the end of the string (as shown below):


Wednesday, October 9, 2013 9:07 PM

Kevin, I think you misunderstood the question...

The poster asked for list internal name, not field and gave an example. I think the TO was confused calling the folder name "list internal name" but pretty sure he did not mean field internal name.

Also, the TO was asking for a JavaScript code solution. So even if he/she wanted the field internal name browsing to the list settings page won't help much.

Perhaps the TO could shed some light and clarify this? If there is an answer here, mark it. If not - clarify what you are looking for?

Regards, Shai Petel.