How to include a clickable link on the catalog item that's accessed on the Service Portal ?

Jagadish10
Mega Expert

Hi All,

I have created a new catalog item that is visible on the Service Portal. In the Catalog Item, I want a clickable link to be displayed. This link shouldn't be in the description.

I created a macro first, and then included that in the macro variable. Wrote a OnLoad client script which has the header reference to the macro.

Macro:

find_real_file.png

Client Script:

document.getElementById('testMacro').href="https://www.google.com"

I replaced document with g_form but still no luck.

I'm able to see the link on the ServiceNow catalog Item view but failed to see that on the Service Portal catalog item.

find_real_file.png

 

Please help me make it visible on the Service Portal's Catalog item.

Thanks

Jagadish

1 ACCEPTED SOLUTION

Hello Jagadish,

 

You need not to use UI macro any more. Please create widget write the HTML code there. Below the screen shot.

 

Then include this newly created widget in your catalog item.

 

find_real_file.png

 

 

 

 

 

 

find_real_file.png

Now include this widget into your Catalog Item ( By creating a new variable of type macro in Item As shown in screen shot below)

 find_real_file.png

 

After adding this variable into the catalog item, open your catalog item in service portal and check you will see this working 

 

find_real_file.png

 

 

 

 

 

Please hit Like if this rings the bell in your mind and mark my response correct if this solves your issue.

View solution in original post

19 REPLIES 19

If I am adding only Widget , I am not seeing it(added a button image) in the catalog item form; I can only see if I add in UI Macro

Hi Bhavya,

 

Widget works on portal only. Please check your catalog item in portal you should be able to locate button when item is opened in service portal. To see that button in native UI, you will have to create UI macro for the same. 

 

 

Please hit the Helpful button if this resolves your query.

 

Thanks,

Kamlesh

I First created a UI Page, included the link in the HTML editor and saved it.

 

Then created a variable of type UI Page and then called that UI page I had created.

This works fine if I try it on the ServiceNow console but doesn't work If I want this link to be displayed on the Service Portal.

 

Thanks

Jagadish

Ujjawal Vishnoi
Mega Sage
Mega Sage

Hi Jagadish,

 

You need to create a widget with the same functionality as given in UI macro. So please follow the below mentioned steps.

1. Create a new service portal widget with html as given below.

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

leave client and server script of widget as it is.

 

2. Open the macro variable and put the widget you created under default section.

find_real_file.png

 

3. Also do not remove macro you already created and selected under type specifications as mentioned below.

find_real_file.png

 

Hope this helps.

 

Regards

Ujjawal

Hi Ujjawal,

I did what you suggested, and it worked perfect for me 🙂

Thanks a Ton.

Cheers

Jagadish