- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2021 09:32 AM
Hi all,
we got a requirement to make label variable type as bold in service portal for a catalog item variable.
I tried this by using a catalog client script. It is working fine in native view. If i open that catalog item request form in service portal, it is showing javascript console error.
Please help me with the best possible to achieve this.
Below is the onload client script i used, its working for Native view but not in Service portal.
function onload(){
g_form.getControl('variable_name').setAttributes('style', font weight : bold);
}
Thank you,
Balaram.
Solved! Go to Solution.
- Labels:
-
Incident Management
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2021 10:05 AM
1. Navigate to Service Portal --> Pages
2. Open Page with ID as sc_cat_item
3. In page specific CSS write below. In below example, the backend variable name of my variable is hard_drive
#hard_drive > div > label
{
font-weight:bold;
}
General
#nameofvariable > div > label
{
font-weight:bold;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2021 10:05 AM
1. Navigate to Service Portal --> Pages
2. Open Page with ID as sc_cat_item
3. In page specific CSS write below. In below example, the backend variable name of my variable is hard_drive
#hard_drive > div > label
{
font-weight:bold;
}
General
#nameofvariable > div > label
{
font-weight:bold;
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2021 09:30 PM
Hi Pranesh,
How to restrict this for one particular catalog item??
if I have same name field in different catalog item, it would affect there right?
I need to make all the variables in one particular item to be bold.
Please provide your input.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2021 09:59 AM
Hi,
getControl isn't available on the service portal. I'd discourage using DOM manipulation and question the requirement. Why is a label needed to be bold? Sounds like help text should be used where the html format can be incorporated in the variable being displayed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2021 10:02 AM
Hi Kieran,
The requirement is to make the field label as the Header similar to the container.
But in my project we are not suggested to use Container fields.
Thank you,
Balaram.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2021 10:31 AM
HI Balaram,
As per your requirement, there are various options available:
- Add the variables in a variable set. The label text can be used as the heading of the Variable set.
- Add CSS in the instance option, but it will be applicable for all the field labels.