Solved: How to include multiple knowledge base in service ... - ServiceNow Community

How to include multiple knowledge base in service portal

RudhraKAM
Tera Guru

Hello , as many of you know that we can only assign one knowledge base in service portal , how to include another knowledge base too ?

My issue with this is, If i have knowledge base A and  in the portal search if i search for some thing which is in that knowledge base it will display that 

but if i want to include knowledge base B as well in the portal search , how can i do that 

 

I tried adding the search source too but no luck , can some one suggest me what to do with this ?

1 ACCEPTED SOLUTION

OK if you want to set specific KBs, change that line to something like the following:

var kbQuery = kb.addQuery('kb_knowledge_base', $sp.getValue('kb_knowledge_base')).addOrCondition('kb_knowledge_base', 'KB-2-SYSID').addOrCondition('kb_knowledge_base', 'KB-3-SYSID');

The idea is KB1 is set in the service portal definition record and the addOrCondition statements add others.

View solution in original post

18 REPLIES 18

Allen Andreas
Administrator
Administrator

Hi,

Unfortunately, I don't think it's possible.


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
I invite you to visit my ServiceNow focused YouTube channel: Allenovation!

Michael Ritchie
ServiceNow Employee
ServiceNow Employee

You can enable the Knowledge Management - Service Portal plugin and it includes a new portal that can search multiple knowledge bases.  More information can be found in Docs:

https://docs.servicenow.com/bundle/kingston-servicenow-platform/page/product/knowledge-management/co...

Nice! Didn't know about that, I guess from the context of keeping it all within that same SP and that same search area, it's not possible. Which is what most people want however, this is a good alternative.


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
I invite you to visit my ServiceNow focused YouTube channel: Allenovation!

Thanks so much but we tried that but we had some issues by enabling that plugin , so do you have any idea can we include another knowledge base in the search source ?find_real_file.png

 

(function(query) {
var results = [];
//Here goes the logic. Compute results however you want!
var kb = new GlideRecord('kb_knowledge');
kb.addQuery('workflow_state', 'published');
kb.addQuery('valid_to', '>=', (new GlideDate()).getLocalDate().getValue());
kb.addQuery('kb_knowledge_base', $sp.getValue('kb_knowledge_base'));
kb.addQuery('123TEXTQUERY321', query);
kb.setLimit(data.limit);
kb.query();
data.article_count = kb.getRowCount();

var kbCount = 0;
while (kb.next() && kbCount < data.limit) {
// Does user have permission to see this item?
if (!$sp.canReadRecord("kb_knowledge", kb.getUniqueValue()))
continue;

var article = {};
$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);
article.score = parseInt(kb.ir_query_score.getDisplayValue());
article.label = article.short_description;
article.primary = article.short_description;
results.push(article);
kbCount++;
}
$sp.logSearch('kb_knowledge', data.q, kb.getRowCount());

return results;
})(query);