Display Hyperlink in catalog item Variable

sai krishna10
Giga Guru

Hi,

I want to display Hyperlink within the catalog item variable in serviceportal. 

Ex: <a href="https://www.google.com">Click Here</a>

In serviceportal i want to display Click Here as hyperlink in the catalog item.How can i achieve this.

 

Regards

Sai krishna

1 ACCEPTED SOLUTION

Hi Sai Krishna,

 

This is possible by setting the "glide.ui.escape_text" system property to false. Once you make this property false, you can use a label type variable and write your a href tag in the Help Text section . 

<a href="https://www.google.com">More information</a>

But this is not advisable since it opens the instance to cross site scripting attacks. Please find below link for your reference

https://community.servicenow.com/community?id=community_question&sys_id=f00fcba1dbdcdbc01dcaf3231f9619f4

 

The safest way is to create a UI macro for this purpose and this also ensures it is compatible to your service portal widget.

 

Thank you.

 

Regards,

Mrudula M

Please hit Correct/helpful depending on impact of response.

View solution in original post

10 REPLIES 10

Omkar Mone
Mega Sage

Hi 

Just check the "Subscribed Questions" OOTB widget. There they gave the way to give <a href> link :-

 

see the screenshot below :-

find_real_file.png 

Kalaiarasan Pus
Giga Sage

Have you checked the variable types? There is a URL type variable that you can try to use.

Mrudula6
Mega Guru

Hi Sai Krishna,

 

You can create a UI macro and embed it in your catalog.Please find below test UI macro which I created. Also, I created a new variable in the catalog of Type : macro and referenced my UI macro to this variable.

 

Test UI macro :

<?xml version="1.0" encoding="utf-8" ?>

<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">

Click <a href='https://www.google.com' target='_blank'>here</a>

</j:jelly>

Let me know how that works for you.

 

Thanks,

Mrudula

Please hit Correct/helpful depending on impact of response.

 

But i want to do it without using Macro variable. Can this will be possible using Label Variable

Hi Sai Krishna,

 

This is possible by setting the "glide.ui.escape_text" system property to false. Once you make this property false, you can use a label type variable and write your a href tag in the Help Text section . 

<a href="https://www.google.com">More information</a>

But this is not advisable since it opens the instance to cross site scripting attacks. Please find below link for your reference

https://community.servicenow.com/community?id=community_question&sys_id=f00fcba1dbdcdbc01dcaf3231f9619f4

 

The safest way is to create a UI macro for this purpose and this also ensures it is compatible to your service portal widget.

 

Thank you.

 

Regards,

Mrudula M

Please hit Correct/helpful depending on impact of response.