The dumbed down answer (Anders and Jaap are smarter than I am) is this:
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 Desciption 1' ---> Product_x0020_Description_x0020_
'Product Desciption 2' ---> Product_x0020_Description_x0020_0
'Product Desciption 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:
/_layouts/FldEdit.aspx?List=%7B37920121%2D19B2%2D4C77%2D92FF%2D8B3E07853114%7D&Field=Product%5Fx0020%5FDescription
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.
Methinks this has turned into a blog post for me! (UPDATE 2009-12-14: I did indeed post an edited version of this to my blog, and the comments and discussion have been interesting.)
M.