- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2022 01:12 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2022 01:34 AM
Hi,
this script worked for me in portal
1) onLoad catalog client script
function onLoad(){
setTimeout(function(){
var aTags = this.document.getElementsByClassName("ng-binding");
var searchText = "My Label"; // give the text for the label to be searched
var found;
for (var i = 0; i < aTags.length; i++) {
if (aTags[i].textContent.toString() == searchText) {
aTags[i].style.backgroundColor = 'grey';
break;
}
}
}, 3000);
}
Output:
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
‎01-18-2022 01:15 AM
try right click on the field and write this code on configure label
var labelcolor = g_form.getLabel('u_crequests.u_risk_rla'); labelcolor.style.color = 'grey';
Hit correct answer or helpful if it was 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2022 01:17 AM
Hi,
Can you share screenshot for your question?
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
‎01-18-2022 01:20 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2022 01:30 AM
Hi,
so it's label variable and you want to add background color to it?
OOB this is not possible but you can use DOM which is not recommended
I have shared solution here on how to make label bold and it works in both native + portal
enhance it for background color
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader