how to show a particular knowledge article in virtual agent topic

sarabjeet
Giga Expert

Hi ,

i want know how can i show a particular knowledge article in virtual agent topic. 

for example if location choosen is A then kb_001 should be visible B is choosen then kb_002 should be visible.

Regards,

Sarabjeet Kaur

12 REPLIES 12

Hi Mark,

I am not sure how can i create one myself. The screen shot i shared are from OOB.

Thanks,

Sarabjeet Kaur

So is something like:

find_real_file.png

What you are after? If a user makes choice X, KB article X is shown like in the image? If so I can share what I did for this.

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Hi Mark,

what i exactly need to know here is how the heading in blue(Getting around in windows) redirect us to KB article page when we clicked over it and below that one paragraph is also coming.

So how to create this?

You are on New York correct? Or if Orlando / Paris, let me know, then I can just share a Topic Block.

If building this yourself. I would image having:

find_real_file.png

Where the Script Action contains something like below. It does use vaInputs.article_number. So something like KB0012345. Change this if you'd like.

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;

The HTML Bot Response would look something like:

<html>
    <body>
        <p><a href="/kb_view.do?sysparm_article={{vaInputs.article_number}}" target="_blank">{{vaVars.short_description}}</a></p>
        <p>{{vaVars.description}}</p>
    </body>
</html>

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

I was going to ask something similar as the logic is the same though the use case is slightly different.

My use case is around company (DS environment). i.e. Comapny X and Company Y get differnet response. 

I have done the lookup and retreived the "HTML" value of the article however, I can't find away to present.

The HTML bot response I can't seem to get to display the value.

And the other responses only show "plain text".

 

I could build a big IF statment but might be a little unsustainable.