Adding a dynamic link to a Catalog Item's Description field

andrew_lawlor
Giga Expert

Hello -- I have a relatively simple question to ask. I've been trying to add a link to a another catalog item from within a catalog item's description. To do this, I want to pull the instance name from a System Property so that the link works across instances. The trouble I'm having is finding a way to insert the JavaScript necessary to retrieve the value of this property.

I want to insert the string value of this piece of JavaScript into the link below: javascript:gs.getProperty('instance_name');

Since this is not a UI page, I'm not sure how to have the JavaScript evaluated dynamically.

<a href="https://(instance name).service-now.com/com.glideapp.servicecatalog_cat_item_view.do?sysparm_id=a65625750c0d914003cb2a8c9ad28079&sysparm_link_parent=beee51cc0a0a3c15012ad91265cda611">

Is there any way to this with HTML/JS in the description field of a catalog item? Or is there a workaround utilizing some other method?

Thanks in advance for your time!

1 ACCEPTED SOLUTION

andrew_lawlor
Giga Expert

Well -- it looks like the answer is more straightforward than using JavaScript. If you leave off the first portion of the URL -- https://(instance name).service-now.com, it automatically points to the current instance. So, "/com.glideapp.servicecatalog_cat_item_view.do?sysparm_id=a65625750c0d914003cb2a8c9ad28079&sysparm_link_parent=beee51cc0a0a3c15012ad91265cda611" points to the correct item regardless of instance.



Thanks again!


View solution in original post

1 REPLY 1

andrew_lawlor
Giga Expert

Well -- it looks like the answer is more straightforward than using JavaScript. If you leave off the first portion of the URL -- https://(instance name).service-now.com, it automatically points to the current instance. So, "/com.glideapp.servicecatalog_cat_item_view.do?sysparm_id=a65625750c0d914003cb2a8c9ad28079&sysparm_link_parent=beee51cc0a0a3c15012ad91265cda611" points to the correct item regardless of instance.



Thanks again!