Share via

sharepoint fields (site columns) title vs internalname vs static name

jasmeeners 0 Reputation points
2024-04-22T14:20:29.19+00:00

sharepoint field DisplayName InternalName StaticName special character conversion

If you create a new site column (field) that contains blanks or special characters, through the sharepoint GUI, then microsoft will convert those characters when it generates the InternalName and StaticName.

For example,

DisplayName = "Test or Test(s)"

InternalName = StaticName = Test_x0020_or_x0020_Test_x0028_s_x0029_

However, if you use an API call to create the site column , for example Add-PnPField, it will allow you to create an InternalName that does not follow this convention. i.e. one that contains spaces and special characters

eg.

Add-PnpField -DisplayName "Test3 or Test(s)" -InternalName "Test3 or Test(s)" -Type Text

this will result in the following Field object:

DisplayName = "Test3 or Test(s)"

InternalName = "Test3 or Test(s)"

StaticName = Test3_x0020_or_x0020_Test_x0028_s_x0029_

Questions:

  1. If you create a field object, with blanks and special characters will this cause problems in the operation of sharepoint?
  2. why does microsoft perform conversions of blanks and special characters?
  3. what is the best way to replicate this behaviour when using an API call to create a FIELD object?
  4. what is the best practice recommended by microsoft when creating a field object via an api call with regards to InternalName and Static Name
Microsoft 365 and Office | Install, redeem, activate | For business | Windows
Microsoft 365 and Office | SharePoint | Development
Microsoft 365 and Office | SharePoint | For business | Windows

2 answers

Sort by: Most helpful
  1. Achim Ismaili 1 Reputation point Microsoft External Staff
    2025-08-13T08:41:00.5+00:00

    The best practice to create a field in the UI is to first create it without spaces and special characters (e.g. "TestOrTests") and after it is created, rename it to e.g. "Test or Test(s)".

    This way, the internal name will be "TestOrTests" and be much easier to read and work with, e.g. if you are defining managed search properties or if you are accessing those columns via API or code.

    The best way working with API is to NOT replicate the behavior with the x0020 in the internal names, when creating fields/columns, but instead use readable internal names (e.g. just omit spaces and special characters and use Pascal Case)

    Was this answer helpful?

    0 comments No comments

  2. RaytheonXie_MSFT 40,496 Reputation points Microsoft External Staff
    2024-04-23T05:57:21.4566667+00:00

    Hi @jasmeeners,

    Per my research, we haven't found any issue when use blanks in the internal name of sharepoint list column. For special characters, you could refer to following document:

    Restrictions and limitations in OneDrive and SharePoint

    The display name is the name that is shown to end user. The internal name is obtained from display name but all special characters and spaces are replaced with Unicode. As the sample in your case, the internal name will auto replace special characters with Unicode if you don't set it. But the internal name could be completely different from display name. For example, your display name is Test3 or Test(s), and your internal name could be any thing like abc or test abc. You can name it according to your preference.

    The best example to understand the internal name is the “Modified By” field which is having the internal name “Editor”. When you edit the column name and change it to something totally different, the internal name doesn’t change.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.