Get the InternalName for a SharePoint List Column

This comes up all the time in the SPServices Discussions on Codeplex. When you are making most Web services calls to SharePoint, you have to use the InternalName rather than the DisplayName. This is true whether you are using SPServices, CSOM, or REST. You may see the InternalName referred to as the StaticName as well. They are a little different, but that doesn’t matter here.

When you create a column in a list or library, you give it a DisplayName. That name may be encoded to some degree – depending on the characters you use – to become the InternalName. The InternalName never changes, no matter how many times you change the DisplayName. (This is why we end up with abominations like a column with an InternalName of “Salary” which has a DisplayName of “Name of Customer”. Rapid prototyping can paint us into these messes if we aren’t careful.)

The DisplayName is the name you’re used to seeing for columns in lists and libraries. You see these names all over the place: on list forms, in list views, etc.

There are a few [relatively] easy ways to get the InternalName if you only know the DisplayName.

  • Go to the List Settings and hover over each column’s name. You’ll see the InternalName after “&Field=” in the Status bar of your browser. Note that the name will be double encoded. For example, if a field’s DisplayName is “My Country”, you’ll see “My%5Fx0020%5FCountry”. The actual internalName is “My_x0020_Country”.
  • Call GetList, which will return the list’s schema and inspect the results in a debugger. Example:
        operation: "GetList",
        listName: "MyList"
  • Call SPGetStaticFromDisplay, with the list name and column name and SPServices will look up the Internal Name for you. Example:
    var thisStaticName = $().SPServices.SPGetStaticFromDisplay ({
      listName: "MyList",
      columnDisplayName: "My Country"

Here’s a little table with some examples of how some column names end up:

DisplayName InternalName Double Encoded Name Notes
Title Title Title “Title” doesn’t have any special characters in it, so all three versions are the same.
My Country My_x0020_Country My%5Fx0020%5FCountry The space is encoded as _x0020_
The underscores are encoded as %5F
My_Country My_Country My_Country No extra encoding! Underscores are not special characters.
My-Country My_x002d_Country My%5Fx002d%5FCountry The dash is encoded as _x002d_
The underscores are encoded as %5F


StaticName versus DisplayName on SharePoint Lists

Good old George2 asked a question over at about SharePoint list and column names today.  If you don’t know it, is an excellent site to get high-end SharePoint assistance!  I liked my response, so here it is as a blog post.

When you create a column on a list, both its DisplayName and StaticName are set to the same value. However, the StaticName contains converted values for some characters, most notably a space ‘ ‘ is converted to ‘x0020’. So if the DisplayName is ‘Product Description’, then the StaticName will be ‘Product_x0020_Description’.

There’s another little bugaboo: The StaticName is limited to 32 characters including the translations for special characters. Because of this, if you have more than one column with the same first 20 characters, SharePoint creates StaticNames as follows:

  • ‘Product Description 1’ —> Product_x0020_Description_x0020_
  • ‘Product Description 2’ —> Product_x0020_Description_x0020_0
  • ‘Product Description 3’ —> Product_x0020_Description_x0020_1
  • etc.

Clearly this renumbering can get confusing, too, so a lot of folks will create their columns without spaces in the names (ProductDescription1) and then change the DisplayName.

The easiest trick to see what the StaticName is (to me), to go to List Settings, and then click on the column name in which you are interested. On the Change Column page, the URL will end in something like:


The StaticName is the value for the Field parameter in the QueryString. However, there’s more encoding to deal with: the underscores (‘_’) are converted to ‘%5f’. So Product%5Fx0020%5FDescription means Product_x0020_Description again.

Whenever you change the DisplayName, the StaticName stays, well, static. This often results in DisplayNames and StaticNames that have nothing to do with each other, so as you are prototyping, it’s a good practice to delete columns and re-add them if you are changing their purpose and therefore their name.