Navigate Up
Sign In
Supporters of Developer
Web

Getting the Field by the Internal Name

Item is currently unrated. Press SHIFT+ENTER to rate this item.1 star selected. Press SHIFT+ENTER to submit. Press TAB to increase rating. Press SHIFT+ESCAPE to leave rating submit mode.2 stars selected. Press SHIFT+ENTER to submit. Press TAB to increase rating. Press SHIFT+TAB to decrease rating. Press SHIFT+ESCAPE to leave rating submit mode.3 stars selected. Press SHIFT+ENTER to submit. Press TAB to increase rating. Press SHIFT+TAB to decrease rating. Press SHIFT+ESCAPE to leave rating submit mode.4 stars selected. Press SHIFT+ENTER to submit. Press TAB to increase rating. Press SHIFT+TAB to decrease rating. Press SHIFT+ESCAPE to leave rating submit mode.5 stars selected. Press SHIFT+ENTER to submit. Press SHIFT+TAB to decrease rating. Press SHIFT+ESCAPE to leave rating submit mode.
Getting the Field by the Internal Name

The Column Display names on a SharePoint List are different to the Internal Names:
e.g. "My Column 1" you will get "My_x0020_Column_x0020_1"

From Web UI

You can get the Internal Names from the url when you go and edit individual Columns on a List.
Steps would be:
1. Go to List Settings
2. Scroll down on page to Columns section
3. In the list of Columns, click on the column names
4. View the address bar of the browser and look for the querystring part:

?List=%7B4F5EF009%2D3318%2D4BEC%2D9EB4%2DC08DE6CEC483%7D&Field=CheckoutUser

5. Then look for the '&Field='

'CheckoutUser'

This it the internal field name for 'Checked Out To' out of the box column.

From PowerShell on Server

Source: Field Types by Brian Caauwe

[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
$site = new-object Microsoft.SharePoint.SPSite("http://sharepoint")
$web = $site.OpenWeb()
$list = $web.Lists["Document Library"]
$list.Fields | Format-Table Title, InternalName, TypeDisplayName, TypeAsString

3rd Party Tools

U2U CAML Builder

Often you require Internal field names for buidling CAML queries, this tool will help you in this instance.

Imtech Fields Explorer

Imtech Fields Explorer allows you not only to to discover the InternalName of Site and List Columns but also explore all of their properties.

Gotchas with Internal Names

GetDataTable Issue

Source: SharePoint List Column Names by Eric Malamisura
If you do a CAML Query and get a DataTable back or you simply call GetDataTable() on one of the Views you will get a DataTable back with the internal names as the column names instead of the friendly names. The below code will resolve this:

DataTable table = list.GetItems(list.DefaultView).GetDataTable();
foreach(DataColumn column in table.Columns)
{
   column.ColumnName = list.Fields.GetFieldByInternalName(column.ColumnName).Title;
}

External Links

Categories:
No categories were selected

Comments

Notify me of comments to this article

E-mail:
   

Add Comment

Title:

 
Comment:
Email:

   


Name:

 
Url: