Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Need to implement catalog URL Macro with the help of Jelly script

ServiceNow Dev3
Mega Contributor

Hi,

I have requirement in catalog item variable. How to achieve this below task with the help from URL macro. Kindly help us.

Field Name: Computer name

Data Type: Text

Data Requirement: Mandatory

Dependencies:
"Need to put the link in help for this field
https://developer.servicenow.com/sp?id=kb_article&sys_id=6cacf78ddb7a674028f5dbf0ce961978gh"

Thank you.

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

You can create UI macro and 1 Widget and link it to Macro type of variable for your catalog item

In that UI macro you can show the link

UI Macro:

HTML:

<?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.w3schools.com" target="_blank">Visit W3Schools.com!</a>

</j:jelly>

Widget:

HTML:

<div>
<!-- your widget template -->
  <p style="font-size:10px; color:navy;"><a href="https://www.w3schools.com" target="_blank">Visit W3Schools.com!</a>
</p>
</div>

Variable Configuration

find_real_file.png

Output:

Native:

find_real_file.png

Portal:

find_real_file.png

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

7 REPLIES 7

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

You can create UI macro and 1 Widget and link it to Macro type of variable for your catalog item

In that UI macro you can show the link

UI Macro:

HTML:

<?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.w3schools.com" target="_blank">Visit W3Schools.com!</a>

</j:jelly>

Widget:

HTML:

<div>
<!-- your widget template -->
  <p style="font-size:10px; color:navy;"><a href="https://www.w3schools.com" target="_blank">Visit W3Schools.com!</a>
</p>
</div>

Variable Configuration

find_real_file.png

Output:

Native:

find_real_file.png

Portal:

find_real_file.png

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi Ankur,

I Facing below error. Kindly help us.

find_real_file.png

Hi,

for & you should be using &amp;

please share what URL you are using

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi Ankur,

I am facing issue in url. Kindly help me.

https://servicenow.com/sp?id=kb_article&sys_id=7cacf78ddb7a6f4028f5dbf0ce9619c1