Virtual Agent reusable topic blocks (+ example) [O... - ServiceNow Community
Mark Roethof
Tera Patron
Tera Patron

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

 

Hi there,

 

With the Orlando release, ServiceNow is introducing "reusable topic blocks" for Virtual Agent. Eureka! This would help to build topics smarter, faster, more manageable, etcetera. Let's dive right into it.

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.

 

find_real_file.png

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".

 

find_real_file.png

find_real_file.png

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.

 

find_real_file.png

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.

 

find_real_file.png

find_real_file.png

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.

 

find_real_file.png

 

After this, simply fulfill the Topic Block Properties.

 

find_real_file.png

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 😀.

 

find_real_file.png

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!

 

C

If this content helped you, I would appreciate it if you hit bookmark or mark it as helpful.

 

Interested in more Articles, Blogs, Videos, Podcasts, Share projects I shared/participated in?
- Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

 

Kind regards,


Mark Roethof

ServiceNow Technical Consultant @ Quint Technology

1x ServiceNow Developer MVP

1x ServiceNow Community MVP

---

LinkedIn

Comments
ankit_sharma487
Kilo Guru

this has been very helpful 🙂 thanks @Mark Roethof  .

miriamberge
Tera Guru

Thank you!  This is exactly what I needed... appreciate the time you take in putting these articles together for the community.

Version history
Last update:
‎08-16-2024 10:34 PM
Updated by:
Contributors