Skip to main content

Thinking out aloud - Dave Hunter's SharePoint Blog

Go Search
Home
Blog
  

Locations of visitors to this page


 Useful Links

  Microsoft UK events
  SharePoint 2007 on CodePlex
  SharePoint Community Portal
  SharePoint User Group
  SharePoint Community Portal
  SharePoint Pedia
  SharePoint MSDN Forums
  SharePoint University
Home > Thinking out aloud - Dave Hunter's SharePoint Blog > Posts > Find out the SharePoint Internal Name for a Column or Site Column
My thoughts and findings on Microsoft Information worker technologies, including MCMS and SharePoint 2007 (MOSS).
Find out the SharePoint Internal Name for a Column or Site Column

When you create a column on a list or site column in SharePoint through the user interface you enter the column name, type and any other properties.  The name is used for the internal name and display name.  The internal name is escaped to remove any special characters and spaces.  The table below displays the list of characters and their escaped version.

Character

Hex Code

Escaped Version

[space]

20

_X0020_

|

7C

_X007C_

-

2D

_X002D_

\

5C

_X005C_

(

28

_X0028_

)

29

_X0029_

'

27

_X0027_

,

2C

_X002C_

!

21

_X0021_

%

25

_X0025_

&

26

_X0026_

?

3F

_X003F_

$

24

_X0024_

£

A3

_X00A3_

"

22

_X0022_

<

3C

_X003C_

>

3E

_X003E_

=

3D

_X003D_

#

23

_X0023_

 

The following are examples of this escaping:

Name entered

Escaped Version

Published Date Published_X0020_Date
Buyer's Name Buyer_X0027_s_X0020_Name
Zip / Postal Code Zip_X0020__X002F__X0020_Postal_X0020_Code

 

Please note: The internal name has a maximum length which is calculated after the internal name has been escaped.

There are a few way's to check the internal name, one of which is the through the User Interface, here's how:

1.  Open a web browser.

2.  If you have created a site column open the site column gallery, if you created a column on a list open the list settings.

3.  Click on the column name.

4.  Check the URL for the "field" querystring parameter, as you see from the screenshot below it contains the internal name.

column

 

Other ways include ...

using .NET

You can also find out the escaped version using the System.Xml namespace and the XmlConvert.EncodeName.  For example:

using System.Xml;

// encode the column name
string escapedString = XmlConvert.EncodeName("Published Date");

// decode the escaped column name
string normalString = XmlConvert.DecodeName(escapedString);

which produces

escapedString = Published_X0020_Date

normalString = Published Date

 

Content Types Viewer

Download it here MOSS Content Types Viewer - Home

More about the Content Type Viewer http://www.davehunter.co.uk/Blog/Lists/Posts/Post.aspx?ID=100.

You can browse to the SharePoint environment, browse the content types and investigate the columns which are associated to the content type chosen, using the "show fields" button.

 

Controlling the internal name

You can control the internal names when you provision the site columns using a feature.  You can also do this using the User Interface by creating a field without any spaces or special characters and then re-edit the column to change the display name with any characters you wish.

 

Hope this helps

  Copyright
This work is licenced under a Creative Commons Attribution-Noncommercial-No Derivative Works 2.0 UK: England & Wales License
  Site Map

Comments

There are no comments yet for this post.

 Dave Hunter

I'm currently a Senior Consultant at Netstore 2e2. I specialise in Microsoft Information Worker technologies (especially MOSS, MCMS and .NET), with over 8 years of experience within this area of specialism. 

I have gained two certifications for MOSS and WSS and look to complete the full certification track soon.

View Dave Hunter's profile on LinkedIn

  Subscribe in a reader


 Latest Posts

I’m attending the first ever SharePoint Saturday in the UK31/08/2010 19:43
I’ve re-joined CIBER UK31/08/2010 19:26
I’ve been Awarded a MVP for SharePoint01/04/2010 19:49
SharePoint 2010 Training on Microsoft E-Learning15/03/2010 17:56
SharePoint UK User Group - Thursday 27th August London Meeting25/08/2009 17:56
CAML Query that filters on the current user23/07/2009 17:50
Microsoft Ramp Up Free SharePoint Developer Training22/07/2009 20:59
How To: Change a SharePoint Application Pool Programmatically07/07/2009 18:08
SharePoint Forums Topping 100 Answers06/07/2009 12:29
Find out the SharePoint Internal Name for a Column or Site Column28/05/2009 09:56
1 - 10 Next