Access the friendly name for a SharePoint Column

Hi,

This is possibly a long shot, but is there a way of accessing the 'friendly' name of a SharePoint column in Forms? I'm talking about a column that I have renamed from it's internal name in SharePoint, not it's label in the Forms panel.

For example I have a form with several fields with shortened internal names, the friendly names are basically nicely worded questions, some are quite lengthy. I have several forms with many fields, so rather than manually creating my own array of internal and matching up the corresponding 'friendly' names, I could try and get these programmatically. Is there a way to get the value of the SharePoint 'display name' for the field?

For example:

Internal field name is 'Q1Help', I've changed the SharePoint display name to 'Q1. Do you know where to go for help on the website?'. I'd like to be able to push the field's display name, and the value of the field into a JSON array of questions and answers.

Is this possible?

Regards,
Andy

Hello @abolam,

You can get the display name of the list column using PnPjs:

pnp.sp.web.lists.getByTitle('ListName').fields.getByInternalNameOrTitle('FieldName').get().then(function(value){
     //log the display name of the column
     console.log(value.Title);
}); 

Please find more information here.

Hi Nikitina,

OK so it's not available within forms, I have to call it via PnP JS - thanks for confirming! :slight_smile:

1 Like