After working on Virtual Agent for a long time now we have realized it is a great plugin and we want to share this knowledge and lessons we learnt during all this time to ease your work. we’ll guide you through Virtual Agent Best Practices, Tips and Tricks and will go through the docs with a more simple language.

If you had ever visited this page on ServiceNow Docs, you as well might have seen this picture :

How to read the Docs - Virtual Agent - Part 1

Have a look at Knowledge results shown in the above screenshot. It contains Article Numbers. But How the results are actually displayed using Virtual Agent? Have a look at below screenshot from a OOTB Topic ‘Search Knowledge Base’ (Provided with ‘ITSM Virtual Agent Conversations’ Plugin) :

How to read the Docs - Virtual Agent - Part 1

Yup. There are no article numbers when used OOTB search.

We had the requirement to make our knowledge search like one shown in the above screenshot. So are you ready to see how did we achieve it?

Step 1) Search for the existing OOTB Topic and Open It.

How to read the Docs - Virtual Agent - Part 1

Step 2) Click ‘Duplicate’.

How to read the Docs - Virtual Agent - Part 1

Step 3) Give it a unique name and click ‘Save’.

How to read the Docs - Virtual Agent - Part 1

Step 4) Click ‘Edit Topic Flow’ in newly created Topic Properties Page.

How to read the Docs - Virtual Agent - Part 1

Step 5) In the designer canvas, locate the bot response ‘Display KB(s)’ that display’s knowledge results.

How to read the Docs - Virtual Agent - Part 1

Step 6) Open ‘Link List Value Expression’ script from response properties.

How to read the Docs - Virtual Agent - Part 1

Step 7) Replace the OOTB Script with the Script given below and click ‘Save’ :

(function execute(header) {
var groupedLinksOutMsg = new sn_cs.GroupedPartsOutMsg();
groupedLinksOutMsg.setHeader(header);
var limit = parseInt(vaVars.limit);
var searchJsonObj = JSON.parse(vaVars.search_kb_json_string);
var index = parseInt(vaVars.index);
var linkBuilder = new global.cxs_SearchResultLinkBuilder();
test = 'OK. Before creating your incident, here are some KB articles that may help.';
test += '';
for (var i = index; i < index + limit && i < searchJsonObj.length; i++) { var link = linkBuilder.build(searchJsonObj[i], vaInputs.portal); var articleLink = link.link; var articleNumber = articleLink.match(/KB\d{7}/); test += ''; } test += ' < table style="text-align: left;" >
< tbody >
< tr >
< td colspan="2">< /td >
< /tr >
< tr >
< th style="width: 30%;">KB Number< /th >
< th >Short Description< /th >
< /tr >
< tr >
< td >< a href = "'+ articleLink + ' " >'+ articleNumber + '< /td >
< td >' + link.label + '< / td >
< / tr >
< / tbody >
< / table >
';
return test;
})(header)

How to read the Docs - Virtual Agent - Part 1

Step 8) Locate the Bot Response ‘Found Result Message’ and delete it.

How to read the Docs - Virtual Agent - Part 1

Congratulation, You have created a customized Incident Display Card. Now all you need to do is add your custom topic block to the Topic.

Follow the Steps given here, to add our customized topic block to the Topic. Once you perform the steps mentioned in this link you can see the result.

How to read the Docs - Virtual Agent - Part 1

Emergys Blog

Recent Articles

  • Migrating from Remedyforce to BMC Helix

    Enhance Your IT Service Management: Migrating from Remedyforce to BMC Helix

    Enhance Your IT Service Management: Migrating from Remedyforce to BMC Helix

    In today’s rapidly evolving business landscape, organizations must constantly seek [...]

    In today’s rapidly evolving business landscape, organizations must constantly seek ways to optimize their IT service [...]

  • Credit Unions to Accelerate Growth with Cost-Effective Hyperautomation

    Credit Unions to Accelerate Growth with Cost-Effective Hyperautomation

    Credit unions are grappling with evolving customer expectations, economic uncertainty, [...]

    Credit unions are grappling with evolving customer expectations, economic uncertainty, and growing competition from fintech startups, [...]

  • Unlocking the Power of Data Warehouse Migration

    Unlocking the Power of Data Warehouse Migration

    Unlocking the Power of Data Warehouse Migration