How to change label value into catalog

Deepa12
Tera Contributor

Hi,

 

When the response is Yes, the catalog item variable label should be change.

 

i have written catalog client script (onchange) to change label value 

g_form.setLabelOf('fieldname', 'newname');

 

But it didnt works, pls assist me to change label name dynamically.

 

 

6 REPLIES 6

Community Alums
Not applicable

Hi @Deepa12 ,

Can you drop the complete script ?

 

Samaksh Wani
Giga Sage
Giga Sage

@Deepa12 

 

Plz Share the Script which you wrote

Pavankumar_1
Mega Patron

Hi @Deepa12 ,

If  simple setLabelOf won't work the try below.

Try code on below URL.

https://servicenowguru.com/system-ui/ui-scripts-system-ui/modifying-label-form-fields-client-scripts...

Still if you have issue please share variable type for which you are trying.

 

If it helps please click Accept as Solution/hit the Thumb Icon.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar

Harish KM
Kilo Patron
Kilo Patron

Hello you may refer the below article. setLabelOf will not work for variable labels

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0758098

Regards
Harish