Service Portal Add text next to the category text

joshuacomeau
Tera Contributor

Looking to add text next to the categories label when selected that text automatically shows is that out of box?
Looking to know how to place a text/disclaimer next to it but only for "Risk Management Systems Category"

joshuacomeau_1-1744297905468.png

 

1 ACCEPTED SOLUTION

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @joshuacomeau 

Out of the box, there's no way to add text as needed. You would have to modify the widget and CSS to achieve this, which will increase the technical debt of the system.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

View solution in original post

2 REPLIES 2

pratikjagtap
Giga Guru

Hi @joshuacomeau ,

Try below options.

Option 1: Use a UI Script (Quickest Way)
Inject a custom message using JavaScript only when a specific category is viewed.

Steps:

  • Go to Service Portal > UI Scripts
  • Create a new script called e.g., Category Disclaimer
  • Use the following code:

$(document).ready(function () {
// Only target the category page
if (window.location.href.includes('/sp?id=sc_category')) {
const categoryName = $('h1').text().trim(); // Grabs the category title

if (categoryName === 'Risk Management Systems') {
const disclaimer = '<div style="margin-top:10px;color:#a94442;font-weight:bold;">' +
'⚠️ Please follow Risk Governance policies when submitting a request in this category.' +
'</div>';
$('h1:contains("Risk Management Systems")').after(disclaimer);
}
}
});

 

Option 2: Customize the Widget (More Control)
If you want more robust formatting or translation support:

  • In Service Portal > Pages, search for the category page: likely sc_category.
  • Open the page → look for the widget that renders the title (like SC Category Page).
  • Clone the widget or edit its HTML template:

<div ng-if="$ctrl.data.category.name === 'Risk Management Systems'" class="alert alert-warning">
⚠️ Please follow Risk Governance policies when submitting a request in this category.
</div>

If my response helped, please hit the 👍Thumb Icon and accept the solution so that it benefits future readers.

 

Regards,
Pratik

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @joshuacomeau 

Out of the box, there's no way to add text as needed. You would have to modify the widget and CSS to achieve this, which will increase the technical debt of the system.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************