Virtual Agent Designer controls

  • Release version: Washingtondc
  • Updated February 1, 2024
  • 2 minutes to read
  • Summarize
    Summarized using AI
    This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.

    Summary of Virtual Agent Designer Controls

    The Virtual Agent Designer empowers ServiceNow users to create conversational interfaces by managing controls within a topic flow. These controls facilitate the collection, processing, and presentation of information, while also enabling record manipulation in your instance.

    Show full answer Show less

    Key Features

    • Start Segment: Automatically included in every topic flow, it allows configuration of a greeting response at the beginning of a conversation.
    • End Segment: Also automatically included, this control can be set up with a final confirmation message before concluding a conversation.
    • User Input: Prompts users for information, capturing their responses during the interaction.
    • Bot Response: Displays messages from the bot to users.
    • Utilities: Manages actions like running scripts or branching conversation paths, and can trigger Flow Designer workflows.

    Using Data Pills and Scripts

    Controls can incorporate various input values such as text strings, data pills, and scripts. Data pills enable easy access to dynamic information without scripting, while scripts offer advanced options, like translation handling. For example, both a data pill and a script can be used to fetch a customer's name.

    Condition Properties

    Most controls have a condition property to determine their usage in a conversation. You can leave it empty for mandatory use, or create conditions using the condition builder or a script. This allows for dynamic conversation flows based on context and data. For instance, a scripted condition can check if a user has permission to create an incident before proceeding.

    Key Outcomes

    By utilizing the Virtual Agent Designer controls, ServiceNow customers can build responsive and context-aware conversational interfaces that enhance user interaction and streamline processes within their organization.

    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.

    Table 1. Control types
    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 Flow Designer workflows.
    For controls that have prompts, messages, default values, or confirmation messages, you can enter any of the following input values:
    • 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. Click the data pill icon (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.

    Table 2. Data pill and scripted responses
    Method Result
    Data pill Data pill selector, showing Input Variables and Script Variables options.
    Data pill selector showing a text control.
    Script An example text control showing a dynamic scripted entry.
    A text control showing a dynamic scripted response message.

    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.

    In user input controls, the condition property determines whether the control is used or skipped in a conversation. To always use the control, leave the condition field empty. To determine the conditions under which the control is used, do one of the following:
    • 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:
    (function execute() {
       var gr = new GlideRecord('incident');
       return gr.canCreate();
    })()
    Sample condition builder defining User with data pill selector set to Input Variables for User.

    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.