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

SharePoint Column Name: Static Name vs. Internal Name vs. Display Name in SharePoint

No comments

Loading

In this “SharePoint column name” tutorial, we will learn about the static name vs. internal name vs. display name in the SharePoint online list or document library. Before getting into the article, let us understand what a column is in SharePoint Online.

What is column in SharePoint Online?

A column in SharePoint Online is a field or attribute in a list or library that is used to store and display data. Columns define the type of information that can be stored, such as text, numbers, dates, choices, or even files, and they help organize and structure data within lists and libraries.

Key Features and Types of Columns in SharePoint Online

  1. Single Line of Text:
    • Description: Stores a single line of text.
    • Usage: Suitable for short pieces of information such as names, titles, or single-word descriptions.
  2. Multiple Lines of Text:
    • Description: Stores multiple lines of text.
    • Usage: Useful for longer text entries such as comments, descriptions, or notes.
  3. Number:
    • Description: Stores numerical values.
    • Usage: Ideal for quantities, amounts, or any numerical data that might require calculations.
  4. Choice:
    • Description: Provides a predefined list of options to choose from.
    • Usage: Useful for standardized data entries such as status, priority, or categories.
  5. Date and Time:
    • Description: Stores date and/or time values.
    • Usage: Suitable for deadlines, event dates, or timestamps.
  6. Yes/No (Boolean):
    • Description: Stores binary data (yes/no, true/false).
    • Usage: Ideal for fields requiring a simple true/false or yes/no answer.
  7. Person or Group:
    • Description: Stores a single or multiple user or group entries.
    • Usage: Useful for assigning tasks, specifying authors, or tracking participants.
  8. Lookup:
    • Description: Retrieves data from another list within the same site.
    • Usage: Useful for creating relationships between lists and reusing data across different lists.
  9. Managed Metadata:
    • Description: Stores terms from a managed metadata service.
    • Usage: Ideal for tagging and categorizing content consistently across sites using a taxonomy.
  10. Hyperlink or Picture:
    • Description: Stores a URL or an image.
    • Usage: Useful for links to external resources or displaying images within lists.
  11. Calculated:
    • Description: Stores a value that is calculated based on other columns.
    • Usage: Useful for performing calculations or concatenations within the list.
  12. Currency:
    • Description: Stores monetary values.
    • Usage: Ideal for financial data that requires currency formatting.
  13. External Data:
    • Description: Stores data from external sources through Business Connectivity Services (BCS).
    • Usage: Useful for integrating data from external databases or systems.

Creating and Managing Columns

  1. Creating a Column:
    • Navigate to the list or library where you want to add the column.
    • Click on “Add column” in the list/library view and choose the column type.
    • Configure the column settings, such as name, description, and additional options specific to the column type.
    • Save the column to apply the changes.
  2. Managing Columns:
    • Go to the list or library settings.
    • Under the “Columns” section, you can view, edit, and manage existing columns.
    • You can also create additional columns or delete unnecessary ones.

Column Settings and Customization

  • Required Columns: Mark a column as required to ensure users must enter a value before saving an item.
  • Default Values: Set a default value for a column to populate new items automatically with a predefined value.
  • Validation: Apply validation formulas to enforce rules and conditions for data entry.
  • Indexing: Index columns to improve the performance of queries and filtering, especially in large lists.

Use Cases for Columns

  • Project Management: Track tasks with columns for task name, assigned to, due date, priority, and status.
  • Inventory Tracking: Manage inventory with columns for item name, description, quantity, price, and supplier.
  • Event Planning: Organize events with columns for event name, date, location, participants, and status.

Columns in SharePoint Online are essential for organizing and managing data effectively. By defining the appropriate columns and configuring their settings, you can create structured and user-friendly lists and libraries that meet your organization’s needs.

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: How can I get the internal colum names of a SharePoint list to appear the same as the display name?

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).

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:

 

About Post Author

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