- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2022 01:41 AM
I need a link to be displayed if a user select "No" from Yes/No field.
How do I achieve this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2022 01:45 AM
Hi,
g_form.showFieldMessage() -> doesn't support showing links
you can use info message to show the link
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2022 01:55 AM
No bud, lots of discussions have happened on this but no good solution ever came out.
You can add a link to the label of the field but that will always be present regardless of the value selected.
Alert also wont support hyperlink.
You can try creating a ui page and trigger that on change and add link on the ui page. That is the closest you can get to this requirement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2022 01:57 AM
okay.
can you please explain a bit on this - "You can try creating a ui page and trigger that on change and add link on the ui page. That is the closest you can get to this requirement."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2022 02:06 AM
Here it is,
Create a UI page like below
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<a href="https://www.google.com" target="_blank">Link</a>
</j:jelly>
On Change Client Script to run this when the value selected is NO
var gm = new GlideModal("Test Page For Comm");
gm.setTitle('Show title'); // Add meaningful title
gm.setWidth(550); //Adjust accordingly
//Opens the dialog
gm.render();
Result:
-Anurag
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-01-2022 09:06 PM
this does not work on service portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2025 06:20 AM
This is a very useful trick to know. Thanks!