- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-24-2020 02:23 PM
Hi all,
Some one suggest me please how to redirect to Portal page based on search Keyword
Ex: when i type Covid19 or coronavirus in search bar automatically it should be navigate to Covid Portal page.
So how can we do this.
if it is not possible to navigate Page , it will be great at least if we show Page url as result .
Keywords : Covid, covid-19, workplace, exposure, travel restrictions, social distance, health, health assessment, coronavirus, covid testing
automatically it has to redirect to Covid-19 page.
Kindly suggest me how to do this functionality
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2020 06:59 AM
Okay great. Here is complete working code for reference.
c.submitSearch = function() {
//--------------------------Covid 19-------------------------------//
//alert(c.searchTerm);
var searchablePagesWhitelist = ['Covid', 'Testing', 'covid', 'covid-19', 'workplace', 'exposure', 'travel restrictions', 'social distance', 'health', 'health assessment', 'CDC', 'coronavirus', 'covid testing'];
var searchablePagesWhitelistMVVp = ['MIssion', 'mission', 'Vision', 'US Eagle', 'SOUL', 'people'];
var searchablePagesWhitelistssp = ['KPI', 'Success Sharing', 'Operating Expenses', 'Member Service'];
if (searchablePagesWhitelist.indexOf(c.searchTerm) > -1) {
// alert("Entered into if condtion");
var CovidnewUrl = $location.search({
id: 'portal_page',
page: 'f409a13a1b9b4410ccc28444cc4bcb1e'
});
spAriaFocusManager.navigateToLink(CovidnewUrl.url());
//var my_url = '/sp?id=portal_page'+'&'+'page'+'='+'f409a13a1b9b4410ccc28444cc4bcb1e';
//spAriaFocusManager.navigateToLink(my_url.Url());
} else if (searchablePagesWhitelistMVVp.indexOf(c.searchTerm) > -1) {
// alert("Entered into MVVP if condtion");
var MVVPnewUrl = $location.search({
id: 'credit_union_page'
});
spAriaFocusManager.navigateToLink(MVVPnewUrl.url());
} else if (searchablePagesWhitelistssp.indexOf(c.searchTerm) > -1) {
// alert("Entered into SSP if condtion");
var SSPnewUrl = $location.search({
id: 'kpi_main_page',
sysparm_domain_restore: 'false',
sysparm_stack: 'no'
});
spAriaFocusManager.navigateToLink(SSPnewUrl.url());
} else if (searchablePagesWhitelistSPPP.indexOf(c.searchTerm) > -1) {
// alert("Entered into if condtion");
var SPPPnewUrl = $location.search({
id: 'portal_page',
page: '36762d99db2ecc507203d12c5e9619d5'
});
spAriaFocusManager.navigateToLink(SPPPnewUrl.url());
} else {
//------------------------------------------------------------------------------//
Kindly mark the comment as a correct answer and other comments as helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2020 06:19 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2020 06:59 AM
Okay great. Here is complete working code for reference.
c.submitSearch = function() {
//--------------------------Covid 19-------------------------------//
//alert(c.searchTerm);
var searchablePagesWhitelist = ['Covid', 'Testing', 'covid', 'covid-19', 'workplace', 'exposure', 'travel restrictions', 'social distance', 'health', 'health assessment', 'CDC', 'coronavirus', 'covid testing'];
var searchablePagesWhitelistMVVp = ['MIssion', 'mission', 'Vision', 'US Eagle', 'SOUL', 'people'];
var searchablePagesWhitelistssp = ['KPI', 'Success Sharing', 'Operating Expenses', 'Member Service'];
if (searchablePagesWhitelist.indexOf(c.searchTerm) > -1) {
// alert("Entered into if condtion");
var CovidnewUrl = $location.search({
id: 'portal_page',
page: 'f409a13a1b9b4410ccc28444cc4bcb1e'
});
spAriaFocusManager.navigateToLink(CovidnewUrl.url());
//var my_url = '/sp?id=portal_page'+'&'+'page'+'='+'f409a13a1b9b4410ccc28444cc4bcb1e';
//spAriaFocusManager.navigateToLink(my_url.Url());
} else if (searchablePagesWhitelistMVVp.indexOf(c.searchTerm) > -1) {
// alert("Entered into MVVP if condtion");
var MVVPnewUrl = $location.search({
id: 'credit_union_page'
});
spAriaFocusManager.navigateToLink(MVVPnewUrl.url());
} else if (searchablePagesWhitelistssp.indexOf(c.searchTerm) > -1) {
// alert("Entered into SSP if condtion");
var SSPnewUrl = $location.search({
id: 'kpi_main_page',
sysparm_domain_restore: 'false',
sysparm_stack: 'no'
});
spAriaFocusManager.navigateToLink(SSPnewUrl.url());
} else if (searchablePagesWhitelistSPPP.indexOf(c.searchTerm) > -1) {
// alert("Entered into if condtion");
var SPPPnewUrl = $location.search({
id: 'portal_page',
page: '36762d99db2ecc507203d12c5e9619d5'
});
spAriaFocusManager.navigateToLink(SPPPnewUrl.url());
} else {
//------------------------------------------------------------------------------//
Kindly mark the comment as a correct answer and other comments as helpful.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2020 07:07 AM
Not sure, what you meant inside of form search?
Can you elaborate.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2020 07:32 AM
sure Asif,
when we enter keywords and click on search button it will redirect to another page
if you see in second image small search box on top side.
so from here also if we tried to search with our keywords then it has to redirect to respective Portal page...
this is the usecase.
i hope you understood the usecase.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2020 07:47 AM
Check which widget is that code coming from. I think its another widget. You might have to follow same procedure as we did earlier for this as well.