Possible to set custom labels in list view using a Client Script?

Staxed
Giga Guru

I have a list view that is pulling First and Last name for two different people.  I'm using dot walking to get the First/Last name, but because of this the labels for both fields are First Name/Last Name...so it shows up twice.

Is there a way I can use a Client Script to change the names of labels in the list view?  These values are already used in many places in our instance, so changing the labels in the table isn't really an option I want to pursue.

2 REPLIES 2

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Staxed, Could you please try the solution mentioned here https://community.servicenow.com/community?id=community_question&sys_id=65e27cb6dbbfeb44d58ea345ca96...and see if that works?

 

- Pradeep Sharma

I tried that previously and it isn't working.  I'm curious if I'm just not writing the code correctly.  I'm trying to apply it to a list view that pulling the info from the user table.  I'm pretty new to this so can't seem to figure out the correct syntax for the field.

 

So right now I'm trying to get the list view for a table that extends another table table that extends the task table, and the label is being pulled via reference from the user table.

My current code is:

function onLoad() {
   g_form.setLabelOf('subject_person.last_name','Subject Last Name');
}

which doesn't work, so I'm curious if I'm doing the subject_person.last_name bit wrong

hopefully that made sense...