How to set the color of a variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2023 08:04 AM
Hi Everyone,
I have a requirement to change the color of a particular variable that is hidden on the portal and visible on the RITM. I made the variable visible on the portal and tried to see if I could achieve this on the portal- so I could make sure it works for RITM. I set the variable as htm and added the following
<font size=4 color='red'><i>Test text for variable</i></font>
When I select try it, it does appear correctly but it is adding a formatting box below that I don't want. However when I go directly to the portal it is not displaying correctly at all. I've attached a few screenshots to explain better. I just need a way for a container or variable to appear in bold and red so the user can easily see it on RITM. I'm open to any ideas you have to achieve this as efficiently with the least code changes.
thanks in advance for your help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2023 09:51 AM
Hi @Gemma4 ,
Is that just a simple label text that you want to have the style? If so just create a Rich Text Label variable, from a Rich Text field, click Source Code and add this: "<p style="font-size: 14pt; font-weight: bold; color: red;">Your text</p>"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2023 10:07 AM
HI There,
Create a new Rich Text Label variable:
- Navigate to the Service Catalog in ServiceNow.
- Create a new catalog item or locate the existing one where you want to display the variable.
- Add a new variable of type "Rich Text Label."
Set the variable content using HTML:
- Click on the variable you created to edit its properties.
- In the variable settings, find the "Default Value" field and select the option to "Write HTML directly."
- In the HTML editor, paste the following code to set the desired formatting:
<p style="font-size: 14pt; font-weight: bold; color: red;">Your text</p>
Regards,
Riya Verma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2023 12:14 PM
Thank you @Riya Verma really appreciate the feedback
Unfortunately I don't have an option to "Write HTML directly"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-21-2023 03:32 AM
@Gemma4 , please try changing the type of variable and then use the styling
Regards,
Riya Verma