Hyperlink in Catalog Item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2022 04:56 AM
Hi,
I have a requirement that whenever the "A" choice is selected on the variable in the catalog item on the service portal, we should display a few hyperlinks displayed as below:
Please review below confluence articles before submitting the request for access:
1) Heading of the 1st page
2) Heading of the 2nd page.
Any help on this how we can achieve this,
- Labels:
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2022 04:59 AM
Hi. You can achieve this with catalog client script, onchange of your variable, showFieldMsg, that will display the message. To embed the hyperlink in your text, use <href> tag. Community does not allow posting hyperlinks, but you can do your research on that.
Please mark Correct and click the Thumb up if my answer helps you resolve your issue. Thanks!
Martin Ivanov
ServiceNow MVP 2023, 2024
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2022 12:15 AM
showFieldMessage() function doesn't support HTML. If you want to add a hyperlink, you have to go ahead with addInfoMessage().
Alternatively, you can follow below link:
To Create hyperlink in Client scripts, showFieldMsg
OR
1.) Create two Rich-text label variables
2.) Create an onChange client script on the choice variable and Set those label variables with hyperlinks using g_form.setLabelOf('variable_name', '<pass the HTML here');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2022 01:40 AM
Hi @Chirag Jain3 ,
Hope you are doing fine.
You can achive the same by creating the variables with type Rich Text Lable and providing the hyperlink on the same . Please find below sample variable for the same.
This lable will be shown as clickable link on the portal as shown in the below screenshot
Now you can write onChange catalog client script to hide or show this variable based on the condition as shown below
// Syntax to Hide/Show variables
g_form.setDisplay('VARIABLE_NAME',false);
Please mark correct / helpful if it helped to resolve your query.
Regards,
Amit Gujarathi
Was this answer helpful?
Please consider marking it correct or helpful.
Your feedback helps us improve!
Thank you!
Regards,
Amit Gujrathi