- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2022 04:26 AM
How to add color to Check Box "Text" -> Adobe Acrobat in service catalog
As im not having Macros
Any ideas
Thanks
Mounish
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2022 06:18 AM
this worked for me in Native + Portal
Remember this uses DOM which is not recommended.
Ensure Isolate Script = False for this
Client Script: Isolate Script False
function onLoad(){
setTimeout(function(){
if(window != null){
// native
var z = document.getElementsByClassName("checkbox-label");
for (k = 0; k < z.length; k++) {
if(z[k].innerHTML == 'Adobe Acrobat'){
z[k].style.color = 'red';
}
}
}
else{
// portal
var aTags = this.document.getElementsByClassName("ng-binding");
var searchText = "Adobe Acrobat";
for (var i = 0; i < aTags.length; i++) {
if (aTags[i].textContent.toString() == searchText) {
aTags[i].style.color = 'red';
break;
}
}
}
}, 3000);
}
Output: Native
Output: Portal
Please mark my response as correct and helpful to close the thread so that it benefits future readers.
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-09-2022 04:31 AM
Hi,
Please follow the solutions provided in below thread on the same query:
https://community.servicenow.com/community?id=community_question&sys_id=7b7cb697dba71b00200f0b55ca9619e0
https://servicenowguru.com/system-ui/field-styles-service-catalog-variables/
Hope this helps. Please mark the answer as correct/helpful based on impact.
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2022 04:41 AM
Thanks Shloke
Its worked as expected
Thanks
Mounish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2022 04:54 AM
But it shows as javascript error in SP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2022 04:56 AM
Mark "Isolate script" field to "false"