46 views

Description 


This article will explain how to change the amount of text (number of characters) displayed on search results in the service portal search page.

This only applies to scripted search sources and specifically the Knowledge Base and Questions and Answers ones OOB. 

Procedure


1) Navigate to service portal > portals and select the portal which has the search source you want to edit.

2) In the related list of the portal record, select the Search Source you want to edit. 

3) Find the code which is returning the text. In the case of Knowledge Base, it is this.

$sp.getRecordDisplayValues(article, kb, 'sys_id,number,short_description,published,text');
article.publishedUTC = kb.getValue('published');
article.type = "kb";
if (!article.text)
article.text = "";
article.text = $sp.stripHTML(article.text) + "";
article.text = article.text.substring(0, 200);
 
4) Edit the line which is cutting down the text, which this:
article.text = article.text.substring(0, 200);

 

Applicable Versions


ALL

Additional Information


Documentation on Search Sources. 

https://docs.servicenow.com/bundle/kingston-servicenow-platform/page/build/service-portal/task/add-table-search-source.html

 

Article Information

Last Updated:2018-08-03 00:35:18
Published:2018-07-11