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

How to show specific KB Article on Virtual Agent Chat Bot

JRY
Mega Guru

Hello Team,

I'm new to virtual agent, and I'm attempting to display a certain KB Article when we search using Keywords that we put to the Topic Properties. I'm not sure how to make a show flow. I tried a few things, but none of them worked. I'm having trouble with the flow. Can somebody assist me?

find_real_file.png

find_real_file.png

 

Below are the scripts which I have written 

Get KB Articles(Script Action)

var getKBArticle = new GlideRecord('kb_knowledge');
getKBArticle.get('number', vaInputs.article_number.getValue());

var description = getKBArticle.getValue('text').replace(/(<([^>]+)>)/gi, "");
if(description.length > 80) {
description = description.slice(0, 78) + '...';
}

vaVars.short_description = getKBArticle.getValue('short_description');
vaVars.description = description;

Get KB Articles(HTML)

<html>
<body>
<p><ahref="/kb_view.do?sysparm_article={{vaInputs.article_number}}"target="_blank">{{vaVars.short_description}}</a></p>
<p>{{vaVars.description}}</p>
</body>
</html>
 
Show Topics(Script Action)
 
(function execute() {
vaSystem.switchTopic(vaVars._setup_explore_help_topic);
})()
 
Please help what needs to be change.
 
Thanks,
JRY

 

1 ACCEPTED SOLUTION

Chaitanya Redd1
Tera Guru

Hi,

Can you try to below steps

  1. Duplicate Topic in Virtual Agent Designer "Search Knowledge Base".
  2. Clone Search Context "Knowledge Search" like below Image

find_real_file.png

 

  3. Go to Related list "Resource Configurations" open record created with name "Knowledge"

  4. In the Resource Configuration go to Related list you will find "Condition" record and set value 

find_real_file.png

 

Add SYSID of Knowledge Base as shown below

find_real_file.png

 

  5. Go to the topic which you cloned/ duplicated you will find Script Variable "search_context_sys_id"  as shown below add SYS ID of Search Context which you created in Default value field.

 

find_real_file.png

 

Then Publish it and try to test it will work.

 

Thanks,

Chaitanya

 

View solution in original post

9 REPLIES 9

Hello @Mark Roethof 

I'm trying find out what caused the issue It's showing wrong articles. I need to show specific Articles based on Topics Keywords/ KB Articles Meta. I'm stuck at this part how to show specific KB Article. Please help me on this issue


find_real_file.png

Contextual Search

find_real_file.png

 

Display KB(s)

find_real_file.png

Thanks,

JRY

Chaitanya Redd1
Tera Guru

Hi,

Can you try to below steps

  1. Duplicate Topic in Virtual Agent Designer "Search Knowledge Base".
  2. Clone Search Context "Knowledge Search" like below Image

find_real_file.png

 

  3. Go to Related list "Resource Configurations" open record created with name "Knowledge"

  4. In the Resource Configuration go to Related list you will find "Condition" record and set value 

find_real_file.png

 

Add SYSID of Knowledge Base as shown below

find_real_file.png

 

  5. Go to the topic which you cloned/ duplicated you will find Script Variable "search_context_sys_id"  as shown below add SYS ID of Search Context which you created in Default value field.

 

find_real_file.png

 

Then Publish it and try to test it will work.

 

Thanks,

Chaitanya

 

@Chaitanya Redd1 

I didn't find this topic in the OOB of San Diego version. 

Could you please me?

Roshini
Giga Guru

Not able to find "Search Knowledge Base". How to get this topic

ankitshukla
Tera Contributor

Hi Team,

 

I am trying to build the chatbot for KB article and below is the point where i get stuck.

1.I need to search a KB article base on keyword but without mentioning in properties.

2.When anyone search content that also of that content is present in any KB than that should display..

 

Please anyone guide me..