Wednesday, July 2, 2008

What is an easy way to find out the internal name of a SharePoint 2007 list column?

The internal name of a SharePoint list column can be different from the display name. This could happen if a column name has been renamed to something else. For example, if you rename the "Title" column to, say, "Company Name", the internal name remains as "Title". Also, spaces in the display name are replaced with "_x0020_" in the internal name. The internal name of "Contract_x0020_Type" would be used for display name "Contract Type".


An easy way to discover the internal name without any programming is:

- add the column to a view
- click on the column name to sort the view by that column
- check the URL for the "SortField=" parameter value.

I did this for a column name "Company Name" and got a URL similar to this:

http://www.domain.com/records/Documents/Forms/AllItems.aspx?SortField=Company%5fx0020%5fName&SortDir=Asc&View=%7b0E0FDBDA%2d1BA5%2d4CE1%2dBEE4%2d191B285E1F8A%7d

The above URL suggests that the internal field for "Compnay Name" is "Company_x0020_Name".

Note that the URL encoding for the underscore is "%5f".

No comments:

Post a Comment