by Luke
30. November 2011 06:19
SharePoint stores field names as XML in the database. When the field properties are viewed in the URL they are then URL Encoded to ensure there aren’t any non-url friendly characters in the URL. The best practices is to NOT put special characters into the field names. Once the field is created the internal name is permanent so go ahead and change your name after you create it.
If you have a field name like ‘Ice / Cream’ it will appear in the url as field=Ice%5Fx0020%5F%5Fx002F%5F%5Fx0020%5FCream
In order to access the fields in code, you need to reference them using the XML formatting. Before you can figure out what the XML is you need to figure out how to decode the URL. Here are a few from the above example
- [space] x0020
- _ %5F
- / %2F
If we decode the above URL for just the underscores we would get:
Ice_x0020__x002F__x0020_Cream
Which reads (Ice[space][forwardslash][space]Cream)
_x0020_ _x002F_ _x0020_
If we decode this further we can get the original column name: ‘Ice / Cream’