Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Change Variable to Bold and Color red in Catalog and ITIL

Gemma4
Mega Sage

Hi everyone,

I have a few variables I need to change the color and make bold. I've read a couple articles but am not having much luck. Below is what I've tried:

Set the sys_properties glide.ui.escape_text to 'fasle'

Then applied the following at question <font size=4 color='green'><i>Name</i></font>  

 

Unfortunately this isn't working as expected. Any suggestions?

Thanks

Bold.png

5 REPLIES 5

Sagar Pagar
Tera Patron

Hi @Gemma4,

 

You need to write Client scripts with Isolated scripts check box as true.

 

Take a look at this article: Field Styles for Service Catalog Variables 


If my response helps to solve your issue. Kindly mark it as helpful & correct. It will be helpful for future readers.
Thanks,
Sagar Pagar

The world works with ServiceNow

Hi @Sagar Pagar 

I did attempt the client script, see attached. Unfortunately the color is not changing and now I get the following error "  ErrorThere is a JavaScript error in your browser console"testclientscript.png

Hi @Gemma4,

 

Have you set Isolated scripts check box as False.

Is it possible to share the console error here?

 

Also, try this scripts as well.

 


var getLblParent= g_form.getElement('variable_name').id.replace('sys_original.','');

var getLblElement = $j("label[for='"+getLblParent+"']").css('color','red');

 

 

If my response helps to solve your issue. Kindly mark it as helpful & correct. It will be helpful for future readers.
Thanks,
Sagar Pagar

The world works with ServiceNow

Hi @Sagar Pagar 

Thank you for the suggestion but I'm still getting a java script error

Yes I did select and unselected the checkbox at Isolated scripts - no difference

I marked my original script inactive and added the new script below. - no difference.

Any other ideas? 

thanks

 

clientscript2.png