Portal Search Experience: Order guide (sc_cat_item_guide) shows as a sc_cat_item

user8928938913
Tera Expert

Hi Community,

 

Just wondering if anyone could provide some suggestions or thoughts on this problem. We've recently upgraded to Tokyo and our portal search experience got a nice little upgrade. We now have "Suggestions" which provides us with a quick way to open items during a search.

 

Unfortunately, we've run into an issue where our order guides are being opened as an sc_cat_item, instead of sc_cat_item_guide when the user uses the "Suggested" feature. As such, the order guide isn't presented properly (does not have the "Next" button or the "Choose Options" button to proceed us to the next step). However, if the user completes the search to see the full results and then selects the item, they will be able to access the result properly (as a sc_cat_item_guide).

 

As an example:

user8928938913_0-1668722428286.png

If the user clicks the "Suggested - Order Guide - TEST", they will be brought to the order guide with the following URL:

https://<instance>.service-now.com/sp?id=sc_cat_item&table=sc_cat_item&sys_id=<sys id>

 

 

user8928938913_2-1668723619094.png

Whereas if they were to see the full list of results from the search and then click on the item, they would be brought to the order guide with the following URL:

https://<instance>.service-now.com/sp?id=sc_cat_item_guide&table=sc_cat_item&sys_id=<sys id>

 

We've tried:

  • Marking the order guide as "No Search" - but this prevents the item from being searched at all
  • Adjusting the Search Profile/Search Source (AI Search > Search Experience > Search Profiles) to hide the Class of Order Guides from the search results - the order guide as a Catalog Item shows up
  • Trying to add order guides as a Facet in the Search Applications (AI Search > Search Experience > Search Applications) - but we get an error "Invalid table name: "sc_req_item_guide". Please ensure that the table is defined in the current search profile's search sources."
    • So we tried to add an indexed source for the sc_cat_item_guide table but it doesn't existuser8928938913_1-1668723402136.png

       

 

At this point, it looks like we are either going to have to disable the Suggested results from showing up or deal with the backlash of our end users being unable to submit an order guide. Our intention would be to be able to prevent specific items (our order guides) from appearing as a Suggested item in the search experience.

 

Any tips or suggestions would be really appreciated!

 

Thank you

1 ACCEPTED SOLUTION

Hi Dale,

 

Try this:

function onLoad() {
   //Type appropriate comment here, and begin script below
	var qury = getParameterValue("id");
	var sysId =getParameterValue("sys_id");
	//alert('ji--  '+qury);
	if(qury == "sc_cat_item"){
top.window.location = "/sp?id=sc_cat_item_guide&table=sc_cat_item&sys_id="+sysId
	}	
	
function getParameterValue(name) {  
    name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");  
    var regexS = "[\\?&]" + name + "=([^&#]*)";  
    var regex = new RegExp(regexS);  
    var results = regex.exec(top.location);  
    if (results == null) {  
        return "";  
    } else {  
        return unescape(results[1]);  
    }  
}
}

 Created on the order guide as an onLoad script

 

View solution in original post

32 REPLIES 32

Gustavo8
Tera Contributor

Hi

Could you find a soslution? 

David Pedroso
ServiceNow Employee
ServiceNow Employee

Hello all,

 

There is a table sp_ai_search_results_action_config which includes Service Portal Catalog Configurations pertaining to search result navigation.  

 

Here is the record you should update:

Action Name: genius_navigation_catalog_order_guide

Portal page: sc_cat_item_guide  (Previously: sc_cat_item)

Short Description: Genius Navigation Catalog Order Guide

Active: true

 

Hope this helps!

 

Rajshekhar Pau2
ServiceNow Employee
ServiceNow Employee

Reported as PRB1619316/KB1213471.

Brad Warman
Giga Sage

Just in case someone else comes across this I found a solution other than using an on load script. In my case, it was the genius results that were not directing the user to the correct view of an order guide. While the AI Search Results Action Configurations has a record called 'Genius Navigation Catalog Order Guide', it wasn't configured for the AI Search Source that was being used. To resolve the issue, I had to create a new record based on the 'Genius Navigation Catalog Order Guide' record, but change the AI Search Source to the one being used by my portal (in my case it was [AI Search Assist] - Service Portal Catalog). Hope this helps!

BradWarman_0-1702362269410.png

 

Miguel Aizer Es
Tera Contributor

Just in case someone gets to this issue, the previous Accepted Solution did not work for me.
I was able to fix this in a different and, I suppose, more scalable way.

I think this is a ServiceNow issue related with the EVAM View Configs custom conditions / column mappings.

 

You can follow these steps to get to the key configurations.

1- Go to your Portal and access it Search Result Configuration:

MiguelAizerEs_0-1718195622564.png

 

2- Open the EVAM Vew Config Bundle where "Taxonomy - Catalog Order Guide Genius Results" should be located.

MiguelAizerEs_2-1718195938302.png

 

3- Open "Taxonomy - Catalog Order Guide Genius Results"

MiguelAizerEs_3-1718196017669.png

 

4- At this point we shoud be seeing this:

MiguelAizerEs_4-1718196144564.png

I do not know why, but the value of "record_class_name" column in this case will allways be "sc_cat_item", so this OOB configuration will never work. I suppose ServiceNow has mapped that column with Cat Item Table column instead of Class column. I could not reach that mapping configuration.

To fix this issue I have created a Dynamic Filter so I can place it in the Custom Conditions, filtering by the column Sys ID.

5- Create a new Script Include (client callable), this is my example:

MiguelAizerEs_8-1718197253515.png


Name: orderGuidesIDs

Script:

 

function orderGuidesIDs() {
	var ids = [];
	var grOrderGuides = new GlideRecord("sc_cat_item_guide");
	grOrderGuides.query();
	while(grOrderGuides.next()){
		ids.push(grOrderGuides.getUniqueValue());
	}
	
	return ids;
}

 


I made it available for All aplication scopes, but it may not be necessary.
Inserted and adjusted the role permissions.

6- Create a new Dynamic Filter, calling the previous script:

MiguelAizerEs_5-1718196795242.png

 

 

7- Go back to "Taxonomy - Catalog Order Guide Genius Results" and change the Custom Condition:

MiguelAizerEs_7-1718196964434.png

In my case: 

 

columns.var__m_sys_search_genius_result_field_095e15b9c32310109e777d127840dd59.__sys_idDYNAMIC98fd1db0873a42505c74eca83cbb35fd

 


98fd1db0873a42505c74eca83cbb35fd is the ID of my dynamic filter, copy yours and palce it afer "DYNAMIC"

- __sys_id is the internal name of the column sys_id.

 

8- Save and test it in your Portal.

If it does not work consistently, go to "Search Results Actions" Module and search for "Genius Navigation Catalog Order Guide", for the AI Search Source your portal is using.
Make sure it has less Order than "Request Item" action configuration:

MiguelAizerEs_9-1718197634784.png