Configuring Typeahead in Service Portal

Vismit Ambre
Giga Guru

Hi Everyone,

 

I am working on Service Portal, specifically on Search Sources. And here is the scenario I am having issues in dealing with:

 

I need the ability to change the href of the result set that are displayed while doing a typeahead. 

 

This is the URL that I am getting redirected to from the typeahead result set -

https://svcnowdev0.service-now.com/sp/?id=favouritetemplates&sys_id=78413e6ddb817f402df07afc0f961937

 

And this is the URL that I want it to be redirected to -

https://svcnowdev0.service-now.com/sp/?id=sc_cat_item&sys_id=6656f722dbaffa0092807aa9bf9619f6&view=s...

 

 

I understand that I have selected the favouritetemplates as the page to be redirected to within the Typeahead tab of the Search Source but if I keep that blank, then I do not get redirected to any page.

 

I suppose I will have to use the Advanced Typeahead config - but I am not aware about how to use variables in that.

or

Do changes in the OOB Typeahead search widget.

Any assistance would be highly appreciated.

 

 

Thanks in Advance,

Vismit

2 REPLIES 2

Alikutty A
Tera Sage

Hi,

On your portal's search source for catalog, the data fetch scripts generates its URL. Please modify in it and you could get this redirected to the right page/URL.

The following line OOB generates the URL for sc items, so change this logic to generate your URL

if (item.type == "sc") {
  item.url = '?id=' + item.page + '&sys_id=' + item.sys_id;

Hi Alikutty,

 

Thanks for your input on this.

If I do changes in the search source for Catalog, it would impact the results of Catalog itself. However, I have a custom made search source which I am using for this requirement.

 

Also, this would change the URL of the results coming in the below page:

find_real_file.png

 

Whereas I am facing issue in the URL of the result set below:

find_real_file.png

 

Do you have any idea on this one?

 

Regards,

Vismit