logo

NJP

Virtual Agent reusable topic blocks (+ example) [Orlando]

Import · Feb 23, 2020 · article

Pre-Orlando

Basically pre-Orlando if we would have a repetitive group of steps for multiple topics or even within a topic, we simply had to duplicate them/build them over and over. There was no possibility to set up something like a subflow. Well maybe a small workaround would be doable for some situations, using vaSystem.switchTopic().

Orlando

With the Orlando reusable a repetitive group of steps for multiple topics or even within a topic, can be placed within a "topic blocks". The short explanation of topic blocks according to the Docs site:

"A topic block is basically a subflow that performs certain actions or conversational tasks in a topic."

Out-of-the-box prebuilt topic blocks

Out-of-the-box, through the "Virtual Agent Platform Topic Blocks" plugin [com.glide.cs.topic_blocks] several prebuilt topic blocks are offered.

Transfer to Live Agent

Transfers a bot conversation to a live agent.

Survey

Presents a survey for collecting feedback with an agent.

_Contextual search_Uses a search phrase to return search results in a card format, such as knowledge articles and catalog items.

Create a reusable topic block

Instead of just going on and on with the theory, let's just set up our first reusable topic block. For example in several of our topics, we are asking the user to enter the name of a person (which is text). Through several User Inputs and Bot Responses the correct user (or actually sys_id) is determined. One of the topics is about which the record is for, one of the topics is about selecting a delegate.

Add a Topic

When adding a new Topic, notice on the Topic Properties a switch field is available: "Reusable topic block". For our new topic block just turn this switch on.

image

Input / output parameters

We already could mimic kinda subflows with the vaSystem.switchTopic() parameter. Though this is unsupported, and we cannot work with inputs or outputs. The new content black can work with inputs and outputs!

Notice the "Start Segment Properties" (inputs) and "End Segment Properties" (outputs) when you click on "Start" or "End".

image

image

Canvas

We'll just skip the exact details on which User Inputs and Bot Responses we are adding to the topic block. If interested in details, you can download this topic block from Share. Basically it's all steps that we are using in some of our topics, to query the correct user, the error handling, etcetera.

image

Input / output parameters (2)

While and after setting our canvas up, the Input and Output parameters come in place. In this case, for the Inputs we defined a "question" and a "type" parameter. Question will be used as message on our first step (User Input Reference Choice "Search String"), and Type will be used throughout the topic to get more personalized messages. For the outputs we defined only "user". With the assistance of the known Date Pill, we've selected an Input Variable which represents the sys_id of the user selected.

image

image

Applying a reusable topic block

Now the topic block is finished, we need to apply it. For this we'll just set up a dummy Topic with only a Bot Response Text on the start and on the end. In between we would like to see our topic block.

Under Utilities, notice the new "Topic Block" utility. Just drag and drop this onto the canvas, in between the both Bot Response Messages. On the right pane, you can simply select all available topic blocks.

image

After this, simply fulfill the Topic Block Properties.

image

Result

When initiating a new conversation and selecting our test topic, the topic block is utilized! Obviously this topic block might even be set up more generic, like having a generic query, able to query also other tables. Though that was not our intent with this article image.

image

Share

An Update Set with this topic block can be downloaded from Share:

- Virtual Agent reusable topic block (query a User record)

---

And that's it actually. Hope you like it. If any questions or remarks, let me know!

Kind regards,

Mar k Roethof

ServiceNow Technical Consultant @ Quint Technology

1x ServiceNow Developer MVP

1x ServiceNow Community MVP

---

LinkedIn

image

View original source

https://www.servicenow.com/community/virtual-agent-nlu-articles/virtual-agent-reusable-topic-blocks-example-orlando/ta-p/2305720