Formatting the Label in Catalog item in Servicenow

Gagandeep2
Mega Contributor

Hi all,

 

I want to format the Label field text . Please guide

1 ACCEPTED SOLUTION

Yes Gagandeep ,

1. Create a widget:Navigate to service portal -- widget

2. Create new and add the code in the html:

<span style="color:red;font-weight:bold;font-size:100%">
  Requested Assistance

</span>

find_real_file.png

 

3. Create a UI macro - Navigate to UI macros (System UI - UI Macros)

 and paste this code

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<span style="color:red;font-weight:bold;font-size:100%">
  Requested Assistance

</span>
</j:jelly>

4. Goto catalog item and in related list create a new variable

5. Select the type as:Macro and in the Type specification select the macro and widget.

find_real_file.png

 

Output:

Native view --

 

find_real_file.png

 

Portal:

find_real_file.png

 

 

 

 

Mark helpful and correct if it helps:

 

Thanks,

CB

 

View solution in original post

9 REPLIES 9

Chander Bhusha1
Tera Guru

HI Gagandeep,

The formatting of the label in portal won't work. 

I would suggest to go with the Macro variable to display just the label.There you can add a macro to it which will appear in the backend and widget which will appear in the portal.

The configuration will be pretty staging forward.

use div with a class with formatting and the same code you write in the macro both places it will work.

Or you can use label html tag as well.

 

Mark helpful and correct.

Thanks,

CB

 

Could you llease tell where is that option available? And also if you could post the screenshot of the example?

Yes Gagandeep ,

1. Create a widget:Navigate to service portal -- widget

2. Create new and add the code in the html:

<span style="color:red;font-weight:bold;font-size:100%">
  Requested Assistance

</span>

find_real_file.png

 

3. Create a UI macro - Navigate to UI macros (System UI - UI Macros)

 and paste this code

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<span style="color:red;font-weight:bold;font-size:100%">
  Requested Assistance

</span>
</j:jelly>

4. Goto catalog item and in related list create a new variable

5. Select the type as:Macro and in the Type specification select the macro and widget.

find_real_file.png

 

Output:

Native view --

 

find_real_file.png

 

Portal:

find_real_file.png

 

 

 

 

Mark helpful and correct if it helps:

 

Thanks,

CB

 

Thankyou so much. It worked