Configuring Typeahead in Service Portal

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2019 04:27 AM
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 -
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
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2019 04:41 AM
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;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2019 05:31 AM
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:
Whereas I am facing issue in the URL of the result set below:
Do you have any idea on this one?
Regards,
Vismit