Is there any option to rename filed label based on condition

akhila13
Tera Expert

Is there any option to rename filed label based on condition

1 ACCEPTED SOLUTION

Barbara L - Gli
Tera Guru

Hi,

In a client script you can script your condition and set the field label using

g_form.setLabelOf('field_name','New Label');

 

View solution in original post

7 REPLIES 7

Bogdan18
Tera Guru

Hi there,

 

Search in Client scripts for Modify Comments Label and see that the getLabelOf and setLabelOf APIs are being used to accomplish this.

Check the APIs on the Developers site https://developer.servicenow.com/app.do#!/api_doc?v=london&id=r_GlideFormSetLabelOf_String_String for more information.

 

Hope this helps,

Bogdan Pirsan

Barbara L - Gli
Tera Guru

Hi,

In a client script you can script your condition and set the field label using

g_form.setLabelOf('field_name','New Label');

 

Thanks Barbara.

 

Is there any way to get the new field label in the report 

Using this method there wouldn't be a way to get it to show up in reports, it would only change it client side in form view. 

If you can give some more details about what you're trying to accomplish with this functionality that could be a help in figuring out how to go about it