4

I am working on a SharePoint server 2016. and using the UI i create a new site column named 2016Summary. now i have noted that this column will have this strange internal name %5Fx0032%5F016Sumamry which is _x0032_016Sumamry if i decode it.

So can anyone advice on these points:-

  1. Should i avoid having site column names which contain numbers?

  2. Now i tried using PowerShell to create the column (instead of using the UI), and i was able to create the site column with 2016Summary internal name... so i am not sure what is going on.. and if i should avoid doing so in powershell ??

  3. If i create a new site column with the following name Summary2016 i will get the correct internal name ... so is the problem that site columns should not start with a number, but it is fine if the other characters are numbers??

Can anyone advice on the below please?

Thanks

4

When you create a column name beginning with numbers in UI , SharePoint converts it internally as below:

_x0032_ + Rest of the field name beginning with second digit.

To answer your questions

1) Avoid column names beginning with numbers as general thumb rule/practice. If you must, then use Powershell to set internal name/display name.

2) Powershell/SSOM/CSOM works differently compared to UI as you have access to schema XML. Hence, you dont face this issue of weird internal column name. As mentioned above, as a practice dont use numbers as starting characters in the column name.

3) It's fine if other characters are numbers.

  • So you are saying it is always better to avoid site column starting with numbers ? even if powershell will allow me to create a site column which begin with a number without doing any strange encoding ??? is there any reason from your point of view to avoid site column starting with a number?? – john Gu May 11 '17 at 16:01
  • Yes and yes. This is my personal opinion. I faced weird issues related to search queries. So, IMHO, only if you must and there is no other option, should you create column names beginning with numbers. Having said that, MS doesnt prohibit this behaviour. Your experience might be different compared to mine :) – Gautam Sheth May 11 '17 at 16:33
0

I know this is an older issue but as of today Feb 2019 in SP online version, when I create a new SITE COLUMN like AG01 then it becomes _x0041_G01

Not sure why it converts the first character into a unicode character.

One way I was able to get the internal names of the columns:

https://<sitepath>/_api/web/lists/getbytitle('myListName')/fields.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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