How to make text of Label type in Bold

taqdeer
Tera Contributor

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.

find_real_file.png

26 REPLIES 26

Nikhil Mahepath
Mega Expert

Hi taqdeer,

Check this community threads:https://community.servicenow.com/community?id=community_question&sys_id=f2628beddb98dbc01dcaf3231f96...

https://community.servicenow.com/community?id=community_question&sys_id=ac718b29db98dbc01dcaf3231f96...

If my answer helped you in any way, please then mark it as helpful.

Kind regards,

Nikhil Kumar M

Aelum consulting pvt ltd

Ankur Bawiskar
Tera Patron
Tera Patron

@taqdeer 

this link should help you

Make a variable type Label bold on Service portal

Regards
Ankur

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

Hi Ankur,

Where do I need to have the script? Could you please assist me on this?

@taqdeer 

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);

}

find_real_file.png

Output:

Native:

find_real_file.png

Portal:

find_real_file.png

Regards
Ankur

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

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.

find_real_file.png

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);

}