Virtual Agent Designer controls
Summarize
Summary of Virtual Agent Designer controls
The Virtual Agent Designer enables you to create conversational topic flows using various controls that collect, process, and present information to users. These controls also interact with your ServiceNow instance by reading, creating, or updating records. Each control type serves a specific function within the conversation, helping you design dynamic and responsive virtual agent experiences.
Show less
Control Types and Their Functions
- Start segment: Automatically appears at the beginning of a topic flow and cannot be added or removed. It can be configured with a greeting message.
- End segment: Automatically appears at the end of a topic flow and cannot be added or removed. It can be configured with a final confirmation message. All conversation branches should connect to this control to properly conclude the interaction.
- User Input: Prompts users and captures their input within the conversation.
- Bot Response: Displays messages from the bot to the user.
- Utilities: Handles actions and logic, such as running scripts, branching conversations, or calling Workflow Studio workflows, enabling advanced interaction flows.
Dynamic Content with Data Pills and Scripts
You can enhance controls by incorporating dynamic values using data pills or scripts:
- Data pills: Provide an easy way to insert dynamic information from variables without scripting. They can be selected using a picker interface from script or input variables.
- Scripts: Allow for more complex logic, including message translation and conditional content generation.
For example, you can display a customer’s name dynamically in a bot response either by selecting a data pill or writing a script that also handles translation.
Controlling Conversation Flow with Conditions
Most controls include a condition property that determines whether the control is executed or skipped during a conversation:
- If the condition field is empty, the control always runs.
- You can specify conditions using a visual condition builder with data pills or provide a script that returns true or false.
This feature lets you create dynamic conversations that adapt based on user context, permissions, or other logic. For instance, a scripted condition can check if the user has permission to create an incident before allowing that action in the conversation.
A Virtual Agent topic consists of a collection of controls within a topic flow. Use these controls to collect, process, and present information to your users. Controls can also read, create, and update records on your instance.
Each set of controls performs specific functions in a conversation flow.
| Category | Description |
|---|---|
| Start segment | Appears automatically in a topic flow and cannot be added to or removed from a conversation. This control can be configured with a greeting response that appears when a conversation begins. |
| End segment | Appears automatically in a topic flow and cannot be added to or removed from a conversation. This control can be configured with a final confirmation message before the end of a conversation. Ensure that all branches of your topic eventually connect to this control. |
| User Input | Prompts and captures information from the user in a conversation. |
| Bot Response | Displays bot responses in a conversation. |
| Utilities | Handles actions and logic within a topic, such as running a script or adding different conversation paths (branches) in a topic. You can also use them to call automated Workflow Studio workflows. |
- Text strings
- Data pills
- Strings with embedded data pills
- Scripts that return strings
Data pills
Use data pills to quickly and easily add dynamic information to your controls without using a script. Select the data pill icon to open the data pill picker interface. In this interface, you can select data from script variables and from input variables set by your User Input controls.
Using data pills enables you to quickly and easily access the data in your variables. In contrast, scripting provides more complex options, like handling translation. The following examples illustrate how to use a text bot response that includes the name of the customer, handled both as a data pill and a script.
| Method | Result |
|---|---|
| Data pill | |
| Script | |
The first example uses the data pill selector to choose Get Name, an
input variable that contains the name of the customer. The second example accomplishes the same
thing using a script. The script example also uses gs.getMessage to handle
translating the message.
Hide or skip this node (condition property)
Almost all controls have a condition property. The exceptions are the Decision utility and the Start and End nodes.
- Create a condition using the condition builder interface, which lets you add data pills to specify conditions built using this interface.
- Provide a script for the condition property that returns a value of true or false. If the return value is false, the control is not used and the conversation will continue to the next control along that branch of the topic.
Use conditions to make your conversations more dynamic based on context, data, or scripted logic.
| Scripted condition | Condition builder condition |
|---|---|
Sample script for conditionally showing the node: |
In this example, a condition script returns a value of true if the current user is able to create incident records. This condition prevents a utilities control from creating an incident when the user does not have permission to do so.