CHunky Universe of Vigourous Astonishing SHarepoint :)

JSOM: Alter a column’s DisplayName

Here is another article in my JSOM series. For one month ago I showed how to alter a column’s ShowInDisplayForm property with JSOM. This time I’ll show a code sample for changing a column’s (field’s) display name. If you want to alter the displayname with Server Object Model, grab the code in the Change Field’s DisplayName in a List.

var ctx = SP.ClientContext.get_current(),              //SP.ClientContext
    field = ctx.get_web()                              //SP.Web
               .get_lists()                            //SP.ListCollection
               .getByTitle('MyList')                   //SP.List
	       .get_fields()                           //SP.FieldCollection
	       .getByInternalNameOrTitle("Body");      //SP.Field
ctx.load(field, "Title");                              //load only Title
ctx.executeQueryAsync(function() {

4 responses to “JSOM: Alter a column’s DisplayName

  1. Bill 2016-03-04 at 15:16

    This will change the field’s Internal Name. I just want to change the field’s Display Name and keep the original Internal Name.

  2. Bill 2016-03-06 at 20:40

    Thanks for helping.
    We are using CSOM – Javascript – SharePoint 2013
    We need to first create the field with a field name like xxxFieldName with no spaces. This will be our internal name. Now, we need to change the display name from xxxFieldName to ‘The Field Name’ without changing the internal name. Unfortunately, the internal name gets gets changed to ‘The Field Name’.
    we need

    We used PowerShell scripts before. It works fine. The field Internal names stay as they were when first created and only the display name changes.

    There are some significant bugs in CSOM Javascript.

    • Bill 2016-03-08 at 16:10

      Here is the answer to my question.
      When first creating the field using JSOM, I am using oFields.addFieldAsXml.
      The xml field node string MUST have the DisplayName attribute value set to the Internal Name before calling addFieldAsXml.
      Once the field is created, using set_title will not change the field’s Internal Name.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Daniel Chronlund Cloud Tech Blog

News, tips and thoughts for Microsoft cloud fans

Вула Чăвашла

VulaCV - Чăвашла вулаттаракан сайт

Discovering SharePoint

And going crazy doing it

Bram de Jager - Architect, Speaker, Author

Microsoft 365, SharePoint and Azure

SharePoint Dragons

Nikander & Margriet on SharePoint

Mai Omar Desouki

PFE @ Microsoft

Cameron Dwyer

Office 365, SharePoint, Azure, OnePlace Solutions & Life's Other Little Wonders


Me and My doings!

Share SharePoint Points !

By Mohit Vashishtha

Jimmy Janlén "Den Scrummande Konsulten"

Erfarenheter, synpunkter och raljerande om Scrum från Jimmy Janlén

Aryan Nava

DevOps, Cloud and Blockchain Consultant


SharePoint for everyone


Ryan Dennis is a SharePoint Solution Architect with a passion for SharePoint and PowerShell

SharePoint 2020

The Vision for a Future of Clarity

Aharoni in Unicode

Treacle tarts for great justice

... And All That JS

JavaScript, Web Apps and SharePoint


Mostly what I know and share about...

%d bloggers like this: