Whenever creating any column for list, SharePoint creates two names for it.
- External name to display in views, forms
- Internal name
Best example to understand internal name is “Created By” field which is having internal name “Author”.
You can change the display name as many times as you want, but can never change the internal name once column is created.
If you are creating field from code behind then you can assign internal name as per your choice, but when doing it thru web SharePoint gives you option to give display name, and creates internal name by itself. When internal name is defined, if you have any of the non alphabet, numeric character as part of name ,SharePoint converts them to special hex codes.
For e.g. trying to create field “Emp Name” gives internal name as “Emp_x0020_Name”
( I guess this may be seems to be part of some security settings, to avoid sql injection etc, since they are allowing characters like ‘(quote), =(equal to), “(double quote), ; (semi colon) etc. You can create column with name ‘ or ‘1=1 which means lot in security)
After some trial and errors I was able to build the conversion table for future reference.
|
Character |
Internal Hex Code |
|
~ |
_x007e_ |
|
! |
_x0021_ |
|
@ |
_x0040_ |
|
# |
_x0023_ |
|
$ |
_x0024_ |
|
% |
_x0025_ |
|
^ |
_x005e_ |
|
& |
_x0026_ |
|
* |
_x002a_ |
|
( |
_x0028_ |
|
) |
_x0029_ |
|
_ |
_ |
|
+ |
_x002b_ |
|
- |
_x002d_ |
|
= |
_x003d_ |
|
{ |
_x007b_ |
|
} |
_x007d_ |
|
: |
_x003a_ |
|
“ |
_x0022_ |
|
| |
_x007c_ |
|
; |
_x003b_ |
|
‘ |
_x0027_ |
|
\ |
_x005c_ |
|
< |
_x003c_ |
|
> |
_x003e_ |
|
? |
_x003f_ |
|
, |
_x002c_ |
|
. |
_x002e_ |
|
/ |
_x002f_ |
|
` |
_x0060_ |
|
|
_x0020_ |
Do leave comment if you find this useful.
SharePoint, SharePoint and stuff : SharePoint Kaffeetasse #64 said,
May 9, 2008 at 6:10 AM
[...] SharePoint Column Names: Internal name mappings for non alphabet. [...]
Prudhvi said,
June 11, 2008 at 2:22 PM
Kudos to you for coming up with this list. It was useful to me not in Sharepoint but while setting up the xslt styles for the excel spreadsheet.
Thanks a lot.
SI PHAM said,
July 14, 2008 at 10:23 PM
This article is extremely useful when you write code to serialize a list item into custom XML part of a Word 2007 .docx document. Each column of the SharePoint list must be encoded in the serialization; in addition, the customXML part need to use this encoded name. For more information, read chapter 7 of the book “Pro SharePoint Solution
Development
Combining .NET, SharePoint,
and Office 2007″
This book is published by APress, and its ISBN is :ISBN-13 (pbk): 978-1-59059-808-5
ISBN-10 (pbk): 1-59059-808-3
Erick Rims said,
September 4, 2008 at 10:17 AM
Really your blog is very cool with good tips of characters and related Internal hex code. The tips are very much useful. Nice work done by you………
really appreciated
thanks
Χρήστος said,
January 8, 2009 at 8:16 AM
I would like to recomend imtech field explorer
(http://blog.mastykarz.nl/imtech-fields-explorer-visual-studio-2008-plugin/) for finding filed names, easily
SaturnVibes said,
April 18, 2009 at 1:57 PM
Thanks for your list of special characters.
I’ve written a program to convert those special characters to the appropriate code here: http://www.saturnvibes.com/SharepointProjectServer2007/post/2009/04/18/Lists-column-internal-name.aspx
SaturnVibes said,
April 28, 2009 at 5:01 PM
Hey, there’s an easier way to get the internal name of a List field. Namely by: list.Field["fieldname"].InternalName
See here for example: http://www.saturnvibes.com/SharepointProjectServer2007/post/2009/04/28/Lists-column-internal-name-Update.aspx
SSR said,
July 14, 2009 at 1:50 PM
Hi,
This posting is helpful. Apart from this I am searching for the representation of non-english charaters in internal names. For eg. if a column is created and named in chinese language then what will be the internal name of the column??
baby said,
September 25, 2009 at 5:45 PM
Great resource