The CreatorCon Call for Content is officially open! Get started here.

Prevent specific records from appearing in Service Portal search results

Joseph Warner
Tera Guru

I have a business requirement to prevent certain standard change templates from appearing within search results within the Service Portal search bar. Is this possible?

 

JosephWarner_0-1683554988709.png

 

1 ACCEPTED SOLUTION

Steven Parker
Giga Sage

Go to the Record Producer table, add columns "Table Name" and "Hide on Service Portal" if there are not currently available in the list view.  Then just filter the Table column to things you would like to hide (I filtered Table Name by *std_ - Standard Change Proposal in my example below) and make "Hide on Service Portal" true.

StevenParker_0-1684787644766.png

 

You can do the same thing on the Service Catalog -> Maintain Items if there are certain catalog items you want to hide.


Please mark this response as correct and/or helpful if it assisted you with your question.
Steven

View solution in original post

8 REPLIES 8

Steven Parker
Giga Sage

Go to the Record Producer table, add columns "Table Name" and "Hide on Service Portal" if there are not currently available in the list view.  Then just filter the Table column to things you would like to hide (I filtered Table Name by *std_ - Standard Change Proposal in my example below) and make "Hide on Service Portal" true.

StevenParker_0-1684787644766.png

 

You can do the same thing on the Service Catalog -> Maintain Items if there are certain catalog items you want to hide.


Please mark this response as correct and/or helpful if it assisted you with your question.
Steven

Accepting this as the solution since this hides both the catalog menu item as well as hiding the item from search results within the portal.

Joseph Warner
Tera Guru

I was able to identify the "No search" column (sc_cat_item.no_search) as an OOTB solution. Problematically, the records I need to prevent from appearing in search results are within the "Standard Change Template" table (std_change_record_producer). To note, std_change_record_producer extends sc_cat_item_producer extends sc_cat_item. With the "admin" role I was able to set "No search" to true and this successfully prevented records from appearing within search results. However, while I was able to edit the "No search" field for "Catalog Items", I am unable to edit the "No search" field for "Standard Change Templates". After much, much, much investigation I was unable to determine the cause. I found no clues looking at ACLs, UI Policies, Client Scripts, etc. Even enabling System Security Debugging was no help since it only showed green/blue for this field with no indication that it was restricted. I was truly hoping for an OOTB solution.

 

Ultimately, I decided to create a fix script to set the "No search" column to "true" for these records. The script is attached. To protect the customer, the template names genericized to Standard Change Template A, B, C.

While there are multiple ways to do everything in ServiceNow, the "Hide on Service Portal" column, which exist on the "Standard Change Template" table (std_change_record_producer) would've accomplished this with no script needed and is OOTB.  Just change False to True.


Please mark this response as correct and/or helpful if it assisted you with your question.
Steven