SharePoint column name - Static Name vs. Internal Name vs. Display Name in SharePoint

Proven 3 SharePoint column name: Static Name vs. Internal Name vs. Display Name in SharePoint

No comments

 25,475 total views,  3 views today

In this “SharePoint column name” tutorial, we will learn about the static name vs. internal name vs. display name in SharePoint online list or document library.

Introduction: SharePoint column name

During our SharePoint development or customization, we often come across the need for SharePoint columns “Display Name” and “Internal Name”. Apart from these two, there is one more name which is the column “static” name, generally, we don’t much deal with this name(at least myself) during the SharePoint customization. However, I was curious to know about the “static” field name. So here, in this article, I will explain what is column display, and internal and static names.

Display Name: SharePoint column display name

As the name implies, it is a display name that is shown to the user. It contains alphanumeric characters with spaces. The column display name can be changed at any time without impacting to column internal name or static name.  Using the “Title” attribute we read the column display name.

Internal Name: SharePoint column internal name

It is an internal name for the column which is used, it is automatically generated from the display name. If the column display name has some special characters those will be converted to ” _0xXXXX_” where “XXXX” is a Unicode hexadecimal representation of the actual character which will be replaced.  For Example The actual “Order ID”  column internal name would be  “Order_0x0020_ID”. Once the internal name is set, it cannot be changed even if the display name (parent of the internal name) is changed because the schema of the internal name is “Gets” i.e. Read Only. 

Schema as per MSDN:

public:
property System::String ^ InternalName { System::String ^ get(); };

Keynotes to remember about Internal name:

  • Unchangeable.
  • Unique within a list.
  • Used as an identifier for the field(during coding developer refer to this name).

Source: The Microsoft documentation about the internal name is here

Static Name: SharePoint field static name

The static name of a column is a changeable version of the Internal name and it is not guaranteed that this will be unique within a list. It has the “Gets or sets” property which allows the developer to change the static name of the column.


public string StaticName { get; set; }

Source: The Microsoft documentation about the static name is here

SharePoint column name – how to read the display, internal and static name of the column from the code?

The below C# code example talks about how we can get the display, internal and static names of all columns from a given list.

SPList myOrderList = web.Lists["OrderList"]; 
foreach (SPField fieldName in myOrderList.Fields)
{
string internalName = fieldName.InternalName; //Getting the internal name of the column.
string staticName = fieldName.StaticName;//Getting the static name of the column.
string displayName = fieldName.Title; //Getting the display name of the column.
}

Get column static name in SharePoint list – How to get the column static name from the SharePoint UI?

The easiest trick to see what the static name is, go to List Settings, and then click on the column name for which we want to see the static name. On the “Edit Column” page, the URL will end up something like below we can see the static name(highlighted in the below screenshot).

https://globalsharepoint.sharepoint.com/sites/TestSite/_layouts/15/FldEdit.aspx?List=%7B9C744FA6%2D252A%2D417B%2DB8E1%2D9D1D861584AB%7D&Field=Order%5Fx0020%5FID

SharePoint column name - column static name

SharePoint column name – Technically how many ways we can provision columns in the SharePoint list?

The “SPField” class is not a single object in SharePoint it’s a collection – based on the needs or circumstances this SPField collection can be used. For example, the column can be provisioned in many ways like in the site collection level, inside the content type, directly in the list level, etc.

More technical details on the “SPField” collection as below:

  • The “SPField” might be represented as a Site Column in “SPWeb.Fields” collection.
  • The “SPField” might be represented as a Site Column that is part of a Content-Type (SPContentType.Fields).
  • The “SPField” might be represented as a column in a list that is coming from a site column (SPList.Field).
  • The “SPField” might be represented as a column in a list that is coming from a Content type(SPList.Field).
  • The “SPField” might be represented as a column in a list where it is created directly in the list (SPList.Field).

A practical example of a column static name: SharePoint field static name

So far whatever we have discussed, it seems both the internal name and static name of the columns are the same. Now we will see the difference.

Let’s say, we have an “Order Number” column in the “Test Order List

SharePoint column name in SharePoint list and document library

Now, we are going to add the content type “Test Order CT” which has the “Order Number“(the same column name which already exists in the list) column associated with it.

SharePoint column name - static field name in SharePoint Online

Here, in the above screenshot, we can see that there are two columns in the list with the same name that is “Order Number

Now let’s double click on the “Order Number” column which has come from the “Test Order CT” content type.

Get internal column name in SharePoint list - SharePoint column name

Then from the “Edit Column” page, we can observe the below:

  • At the end of the column internal name “Order_x0020_Number“(in the browser URL) ‘0‘ is added. This zero automatically gets incremented by the number one whenever any new column gets provisioned to the list thru the content type which already exists. And this version of the changed internal name is called a static name.
  • When the same column “Order Number” was created directly in the list that internal name was generated as “Order_x0020_Number“.
  • The internal name is unique and read-only in the list by the design of SharePoint –  two columns with the same name can not be provisioned to the list. But by the StaticName, we can have two columns with the same name in the list which we saw in the above example.

Summary – What do we have here (SharePoint column name)?

Thus, in this article, we have learned what exactly column display and internal and static names are.

See Also: SharePoint Online tutorial

You may also like the below SharePoint Online tutorials:

PDF Download Image

Download SharePoint Online & Office 365 Administration eBook

Buy the premium version of SharePoint Online & Office 365 administration eBook from here:



Buy SharePoint Online & Office 365 Administration eBook


 

Get the free demo PDF eBook from here:

FREE DOWNLOAD

Send download link to:

Subscribe to get exclusive content and recommendations every month. You can unsubscribe anytime.

About Post Author

Do you have a better solution or question on this topic? Please leave a comment