19

I am using SharePoint Server 2007 Enterprise with Windows Server 2008 Enterprise, and I am using publishing portal template. I heard for SharePoint list/list column, it has an internal name which could be used for programming (as identifier for list/list column), and also has a display name (which is showed for end user for list name or list column name).

How to find and set such internal name and display name for list/list column?

11 Answers 11

44

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.

5
  • 2
    Well explained Marc. Thanks for the tip to use the url tip! Dec 11, 2009 at 16:23
  • Can I change internal name either in programming way or from any tools?
    – George2
    Dec 11, 2009 at 18:57
  • 1
    heh yeah i often use that shortcut too ;-) George: why would you rename internal names? As Marc explained for columns/fields created in the GUI you should just omit spaces when you create them, then add them afterwards. Also you dont have this issue at all if you use features or code to create them. Dec 11, 2009 at 20:20
  • Marc, I have created a list but with wrong internal name -- could confuse other people in the future. I want to save my efforts to re-create the list again and try to find a quick way to change intrenal name. Any solutions to change the internal name?
    – George2
    Dec 12, 2009 at 14:59
  • I just retrieve the list columns using pnp-powershell and from there I get the list fields
    – Alberto S.
    May 22, 2019 at 13:18
9

You can use SharePoint Manager to inspect properties of existing fields, including the InternalName

3
  • Can I change internal name?
    – George2
    Dec 11, 2009 at 18:43
  • No you can't. But you can be a bit creative while creating the column to get the internal name you want. ;) Mar 13, 2016 at 17:49
  • I want to update the SharePoint Manager link above since there's a 2013 version: spm.codeplex.com
    – YogaPanda
    Mar 21, 2016 at 14:41
6

Actually there are three strings involved, as can be easily seen from object model examination (or use of SharePointExplorer).

  1. DisplayName/Title

  2. StaticName

  3. InternalName

The StaticName of the site column can be updated by changing it in the feature ("StaticName" attribute) and redeploying. Then if the feature receiver gets the SPSite.SPField and calls Update, that will update the StaticName of all list instances.

The InternalName of the site column can be updated by changing it in the feature ("Name" attribute) and redeploying.

However, the site column InternalName is not propagated to list instances via SPField.Update, and AFAICT, cannot be changed, updated, or fixed at all.

Perhaps it is possible by twiddling with the underlying rows in the database, but that is obviously unsupported.

5

aside from using Sharepoint Explorer (wich is probably the best option), and in case that you need only the column internal name, you could also use u2u caml query builder. Also, you can find the column internal name when you browse the list, on its configuration page, and select any of the available columns. You can see that the internal name it is passed as an argument in the query string, inside the 'Field' key.

1
  • I create the list from SharePoint UI by adding List/Columns, then can I change internal name either in programming way or from any tools?
    – George2
    Dec 11, 2009 at 19:01
4

If you mean list template ID's you can find them here: http://msdn.microsoft.com/en-us/library/dd586520(office.11).aspx

Also theres the FieldId and PropertyConstant classes:

FieldId defines constants that you should use to reference SharePoint fields. PropertyConstants is the same deal, but for UserProfile fields.

Theres also lots of enumerations that you should use instead of hardcoding strings or id's. You will need to go scouting the API for a complete list, but one such enum is the ListType enum

hth Anders Rask

1
  • I create the list from SharePoint UI by adding List/Columns, then can I change internal name either in programming way or from any tools?
    – George2
    Dec 11, 2009 at 18:58
2

Better idea is Delete column and Recreate.Is the Best solution

2
  • 1
    @Naresh: That's fine if no lists use the data in the column. In any other case the data will be lost.
    – Alex Angas
    Jan 28, 2010 at 22:23
  • we can copy those data by spread sheet view for editing or access Dec 6, 2016 at 5:39
2

if you like me seek internal name in odata format

answer is here

OData__x0031_394

like this.

for do that enough to type in address bar this url :

http://server-sharepoint-name/_api/lists('%7B5EF6FE58-BD05-4C1E-9A3D-2CD9E219EBDD%7D')/items

and instead %7B5EF6FE58-BD05-4C1E-9A3D-2CD9E219EBDD%7D should replace your list ID

in the body of your explorer appear column names:

<?xml version="1.0" encoding="utf-8"?>
<feed xml:base="http://srv-shp-name/_api/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml">
    <id>fa843c10-bec8-4cd0-a52b-f1f2144bee9b</id>
    <title />
    <updated>2016-09-16T14:04:54Z</updated>
    <entry m:etag="&quot;2&quot;">
        <id>Web/Lists(guid'5ef6fe58-bd05-4c1e-9a3d-2cd9e219ebdd')/Items(1)</id>
        <category term="SP.Data.SatheBarNameRiziSode4AmaliatEjraeiListItem" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
        <link rel="edit" href="Web/Lists(guid'5ef6fe58-bd05-4c1e-9a3d-2cd9e219ebdd')/Items(1)" />
        <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/FirstUniqueAncestorSecurableObject" type="application/atom+xml;type=entry" title="FirstUniqueAncestorSecurableObject" href="Web/Lists(guid'5ef6fe58-bd05-4c1e-9a3d-2cd9e219ebdd')/Items(1)/FirstUniqueAncestorSecurableObject" />
        <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/RoleAssignments" type="application/atom+xml;type=feed" title="RoleAssignments" href="Web/Lists(guid'5ef6fe58-bd05-4c1e-9a3d-2cd9e219ebdd')/Items(1)/RoleAssignments" />
        <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/AttachmentFiles" type="application/atom+xml;type=feed" title="AttachmentFiles" href="Web/Lists(guid'5ef6fe58-bd05-4c1e-9a3d-2cd9e219ebdd')/Items(1)/AttachmentFiles" />
        <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ContentType" type="application/atom+xml;type=entry" title="ContentType" href="Web/Lists(guid'5ef6fe58-bd05-4c1e-9a3d-2cd9e219ebdd')/Items(1)/ContentType" />
        <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/FieldValuesAsHtml" type="application/atom+xml;type=entry" title="FieldValuesAsHtml" href="Web/Lists(guid'5ef6fe58-bd05-4c1e-9a3d-2cd9e219ebdd')/Items(1)/FieldValuesAsHtml" />
        <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/FieldValuesAsText" type="application/atom+xml;type=entry" title="FieldValuesAsText" href="Web/Lists(guid'5ef6fe58-bd05-4c1e-9a3d-2cd9e219ebdd')/Items(1)/FieldValuesAsText" />
        <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/FieldValuesForEdit" type="application/atom+xml;type=entry" title="FieldValuesForEdit" href="Web/Lists(guid'5ef6fe58-bd05-4c1e-9a3d-2cd9e219ebdd')/Items(1)/FieldValuesForEdit" />
        <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/File" type="application/atom+xml;type=entry" title="File" href="Web/Lists(guid'5ef6fe58-bd05-4c1e-9a3d-2cd9e219ebdd')/Items(1)/File" />
        <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Folder" type="application/atom+xml;type=entry" title="Folder" href="Web/Lists(guid'5ef6fe58-bd05-4c1e-9a3d-2cd9e219ebdd')/Items(1)/Folder" />
        <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ParentList" type="application/atom+xml;type=entry" title="ParentList" href="Web/Lists(guid'5ef6fe58-bd05-4c1e-9a3d-2cd9e219ebdd')/Items(1)/ParentList" />
        <title />
        <updated>2016-09-16T14:04:54Z</updated>
        <author>
            <name />
        </author>
        <content type="application/xml">
            <m:properties>
                <d:FileSystemObjectType m:type="Edm.Int32">0</d:FileSystemObjectType>
                <d:Id m:type="Edm.Int32">1</d:Id>
                <d:ContentTypeId>0x0100470E097D26C9784F9F4375502DB04E4B</d:ContentTypeId>
                <d:Title>استان آذربایجان غربی</d:Title>
                <d:OData__x0031_393 m:type="Edm.Double">690</d:OData__x0031_393>
                <d:OData__x0031_394 m:type="Edm.Double">1874</d:OData__x0031_394>
                <d:OData__x0031_395 m:type="Edm.Double">20505</d:OData__x0031_395>
                <d:OData__x0031_396 m:type="Edm.Double">27011</d:OData__x0031_396>
                <d:OData__x0031_397 m:type="Edm.Double">7390</d:OData__x0031_397>
                <d:Total93toNow>57470.0000000000</d:Total93toNow>
                <d:ostanId m:type="Edm.Int32">9</d:ostanId>
                <d:ID m:type="Edm.Int32">1</d:ID>
                <d:Modified m:type="Edm.DateTime">2016-08-28T15:06:56Z</d:Modified>
                <d:Created m:type="Edm.DateTime">2016-08-19T08:27:36Z</d:Created>
                <d:AuthorId m:type="Edm.Int32">33</d:AuthorId>
                <d:EditorId m:type="Edm.Int32">33</d:EditorId>

xml tags like this

7390

OData__x0031_397

0

If you have Terminal Server access to the SharePoint server, the easiest way for me is to use SharePoint Management Shell and run the following:

$w = get-spweb http://server/path_to_site
$l = $w.Lists['your_list_TITLE_here']
$l.Fields | sort Title | ft Title, InternalName

The 'Title' column lists the field display name, and the 'InternalName' column its internal name.

As an alternative to server-side PowerShell, you can use SharePoint REST API:

http://server/path_to_site/_api/web/lists/GetByTitle('your_list_TITLE_here')/Fields?$select=Title,InternalName&$orderby=Title

That returns the same information formatted as an OData response. You may use the browser but some REST client is better, like Advanced Rest Client for Chome.

0

The easiest way I found was to right click on the list view page and then "View Page Source" and then Ctrl + F a representative from he list.

This way you can find all internal column names easily.

0

Following Saber response, it might be easier to use the API and only get one record as below

 https://company.sharepoint.com/sites/SPsite/_api/web/lists/getbytitle('Nameofthelist')/items(ID of an item (e.g. 2))/ 

e.g.

 https://acsp.sharepoint.com/sites/SPsite/_api/web/lists/getbytitle('test1')/items(2)/ 
0

This should help you to find both display names and internal names:

How to find display name of list columns?

You can find/see the display name of list columns in list view itself. If you want to check the display names of all list columns, navigate to List settings page.

You can see the display name of all list columns under Columns section on list settings page:

enter image description here

Here you can see the display name of column under Column (click to edit) section.


How to find display name of list column?

There are multiple ways to get the internal name of your SharePoint column, via SharePoint UI, SharePoint REST API or PowerShell.

You can use endpoint like below to get the internal name using SharePoint REST API:

<siteUrl>/_api/web/lists/getbytitle('List Name')/fields?$select=Title,InternalName&$filter=Title eq 'Created By'

You can find other ways in this article: How to find the Internal name of columns in SharePoint Online? - Use classic experience approach of SharePoint server versions

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.