Welcome to part 13 of the Builder series.
In this video we’ll show you how to add a chatbot conversation to your application.
This video builds on the use case from previous videos in this series and references the Safety application built earlier.
Our safety manager, Luke Wilson, would like us to build a chatbot conversation...
... so that employees can create safety issue records without using a form or calling the safety team.
Chatbot conversations allow users to quickly obtain information...
... make decisions, and perform common work tasks through self-service.
The chatbot technology on the Now Platform is called Virtual Agent and requires the Glide Virtual Agent plugin.
If it isn’t already activated, you can activate this plugin on your instance with the admin role.
We’re already logged in to our instance with that role.
We’ll start by navigating to Collaboration > Virtual Agent > Designer.
Here we add a new topic, give it a name and short description...
... and add keywords to trigger this particular conversation (or topic).
After we save it, we can edit the topic flow to build out the conversation.
The palette on the left contains different controls we can use to build out the conversation.
As we place them on the canvas, the property sheet on the right displays the property for the selected control.
First, we’ll click the Start segment and put in a welcome message.
And just to be friendly, let’s add the user’s name by clicking the data pill picker and selecting Input variables > User > Name.
Now a quick save, and we preview our trivial conversation using the Preview button.
It looks like we’re off to a good start, so let’s keep building.
After offering a greeting, we’ll take a Text input from the palette and drop it just under Start.
We give it a name...
... and provide a user-friendly prompt to get a little more information about the issue.
Next, we’ll take a Static Choice input and place it below the short description...
... name it Category...
...fill in a friendly prompt...
... and add our choices here for Big and Small safety issues based on the requirements from earlier videos in this series.
Now let’s add a Reference Choice to allow the user to select a location for the safety issue.
After providing a name and a prompt, we come down to the Table field and select the Location table.
Then we add a filter to refine the choices.
In this example, we’ll get the records where the Name field isn’t empty.
And finally, a message indicating that no records matched our search.
According to our safety manager, we only need a due date if the category is big...
... so we’re going to scroll down on the palette to Utilities, pick a Decision, and add it here for the category size.
We’ll then place a Date Time input below it and fill in the details to get a due date.
Now it wouldn’t be much of a decision if we only had one path that always executed….
So we’ll click the Always label and modify the properties with a better name...
... and specify a condition when the flow should take this path.
By clicking the plus icon under the decision box, we can make additional paths.
In this case, we’ll make another one called Small, to be followed when the category is small.
Again, we’ll go to Utilities and this time pick Action and place it just below the due date.
We give it a name, Create Issue; Action Type, Create Record; and select the table.
In the Fields section, we click Add Field.
Now it’s just a matter of defining which fields we want to populate on the new record.
Using the input variables, we can populate the values from the user’s input.
When that’s done, we connect the decision path from the Small category directly to the Create Issue action...
... bypassing the Due date prompt.
Next, we add a Card response to let the user know we’ve created an issue...
... and offer a few details by adding fields here.
On the End segment, we add a thank-you message, similar to our greeting.
Let’s do another preview.
Here’s our welcome message…
We’ll enter a short description…
Pick a category…
And location…
And because we chose a category value of Big, the system requests a due date.
Here’s the summary of what was created with our thank-you message.
And clicking this link on the card takes us right to the new record.
Now that we’ve tested our Virtual Agent topic, the final step is to publish it to make it available to our employees.
Consider using a chatbot to quickly help users obtain information, make decisions, and perform common work tasks in your application.
For more information, see our product documentation, knowledge base, or podcast.
Or ask a question in the ServiceNow Community.