The CreatorCon Call for Content is officially open! Get started here.

Catalog Client Script to change display label value?

MBarrott
Mega Sage

I have an onChange Catalog Client Script which is checking for change to a name field. 

 

I would like to then have this name display within the display value variable I have on the form. 

 

I've tried g_form.setValue('display_var', newValue); and g_form.setLabelOf('display_var', newValue); but neither have updated the display label. 

 

What's the scripting solution to this?

1 ACCEPTED SOLUTION

MBarrott
Mega Sage

For anyone curious I did some digging and ServiceNow specify that this actually shouldn't be possible and is expected behavior. 

 

This has been addressed on KB0758098: https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0758098

View solution in original post

13 REPLIES 13

@MBarrott 

 

I tried with Label type field as well and it is working on Service Portal. Refer below screenshots:

AmitVerma_0-1741845741209.png

 

AmitVerma_1-1741845777802.png

 


Please mark this response as correct and helpful if it assisted you with your question.

@Amit Verma Could you show the script you're using for the label change? Curious why mine wouldn't be updating correctly. 

@MBarrott 

are you saying it's working in native but not in portal?

refer my solution here which you can enhance

How to make text of Label type in Bold 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

MBarrott
Mega Sage

For anyone curious I did some digging and ServiceNow specify that this actually shouldn't be possible and is expected behavior. 

 

This has been addressed on KB0758098: https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0758098