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.

Help make service catalog item variable bold and color on portal

Service Manager
Kilo Guru

Hi All,

I created a variable with label type and wrote a catalog client script to make it bold and color. It is not working on portal, I get error "there is a javascript error in your browser console" on portal

function onLoad() {
var text = $j("label[for='IO:f37690b2db1d53c0fee9f7d41d96195a']"); // f37690b2db1d53c0fee9f7d41d96195a is the sys_id of label: vac_details
text.css('font-weight', 'bold');
text.css('font-size', '125%');
}

Thanks
1 ACCEPTED SOLUTION

Allen Andreas
Tera Patron

Hi,

What you can do is create a widget with HTML (https://docs.servicenow.com/bundle/orlando-servicenow-platform/page/build/service-portal/task/create...) that has the text you want for the label and you can make it bold, etc. and then add that to your catalog item as a "macro" variable (https://docs.servicenow.com/bundle/orlando-it-service-management/page/product/service-catalog-manage...).

Example:

find_real_file.png

This is where you'd associate that new widget you made to your macro variable.

 

<div>
  <b>This is a bold label!</b>
</div>

find_real_file.png

 

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

View solution in original post

1 REPLY 1

Allen Andreas
Tera Patron

Hi,

What you can do is create a widget with HTML (https://docs.servicenow.com/bundle/orlando-servicenow-platform/page/build/service-portal/task/create...) that has the text you want for the label and you can make it bold, etc. and then add that to your catalog item as a "macro" variable (https://docs.servicenow.com/bundle/orlando-it-service-management/page/product/service-catalog-manage...).

Example:

find_real_file.png

This is where you'd associate that new widget you made to your macro variable.

 

<div>
  <b>This is a bold label!</b>
</div>

find_real_file.png

 

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!