Variable type URL - how to render as a clickable link
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2017 04:08 PM
I have a requirement for a URL type variable to render as a clickable link when displayed in the Variable Editor on the Item or Catalog Task form. Can this be done? I see there is a Variable Type of URL. My assumption is that when the User enters as URL in this variable (eg , https://community.servicenow.com/ ) it will show as a link in the variable editor.
I have searched the forums, and can only find suggestions for adding macros, or creating UI pages. I am sure it must be simpler than that, or there wouldn't be a URL type.
Any suggestion would be greatly appreciated. Thanks.
- Labels:
-
Team Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2017 08:22 PM
Yes, I went down the path of an earlier response from this link: URL type variable on catalog form
You create a new variable, type is Macro with Label. The Macro points to the UI Macro in the above link, it's all there.
The only issue I had in the above link was that the link didn't open in a new tab, you just have to add the html code ( target="_blank") to the end of the link in the UI Macro for that part. Here's the variable, the macro is below. Once you use it, you'll see how easy it is.
Here's the UI Macro
Name: Google_Macro
Description:
XML: |
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<html>
<body>
<div id="sample_check"> <font>BYOD </font>
<a href="https://www.google.com" target="_blank"><b><font color="Blue">here</font></b></a><font> to surf google.</font>
</div>
</body>
</html>
</j:jelly>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-23-2019 06:29 AM
This post has been very helpful...although I need a little more information. I am trying to display a dynamic link. The actual URL is captured in another variable on the Catalog Task. How do I call the UI macro and pass the URL to it so that the link renders and points to the correct address?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-12-2020 01:24 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-22-2021 06:34 AM
Hi nt,
Did you find a solution for this please?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-22-2021 10:47 AM