How to make text of Label type in Bold
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2021 05:29 AM
Hi All,
I want to make Header in Bold. I have created it as of Label Type and I am not able to make it bold and big. Could any one please help me in making this text bold. Below is the screenshot for the reference.
customization is header here. I want to make it bold in black color.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2021 06:24 AM
Hi taqdeer,
Check this community threads:https://community.servicenow.com/community?id=community_question&sys_id=f2628beddb98dbc01dcaf3231f96...
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Nikhil Kumar M
Aelum consulting pvt ltd
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2021 06:24 AM
this link should help you
Make a variable type Label bold on Service portal
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2021 06:43 AM
Hi Ankur,
Where do I need to have the script? Could you please assist me on this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2021 07:36 AM
Is this required only for 1 catalog item?
You can use this catalog client script onLoad and make the Label variable as Bold
Script: This will work in both native + portal
1) Ensure Isolate Script field is set to false for this client script
2) This field is not on form but from list you can make it false
function onLoad(){
setTimeout(function(){
if(window != null){
// native
g_form.getControl('my_label').setAttribute('style', 'font-weight: bold;color:blue');
}
else{
// portal
var aTags = this.document.getElementsByClassName("ng-binding");
var searchText = "My Label";
var found;
for (var i = 0; i < aTags.length; i++) {
if (aTags[i].textContent.toString() == searchText) {
aTags[i].style.fontWeight = 'bold';
break;
}
}
}
}, 3000);
}
Output:
Native:
Portal:
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2021 08:22 AM
CHi Ankur,
Yes, this is for only one cataog item.
I Tried the above script and it didn't work for me:(
Below is the script I used. Could you please let me know if anything has to be changed.
function onLoad(){
setTimeout(function(){
if(window != null){
// native
g_form.getControl('my_label').setAttribute('style', 'font-weight: bold;color:blue');
}
else{
// portal
var aTags = this.document.getElementsByClassName("ng-binding");
var searchText = "CUSTOMIZATION";
var found;
for (var i = 0; i < aTags.length; i++) {
if (aTags[i].textContent.toString() == searchText) {
aTags[i].style.fontWeight = 'bold';
break;
}
}
}
}, 3000);
}