Text bot response control

  • Release version: Xanadu
  • Updated January 30, 2025
  • 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 Text bot response control

    The Text bot response control in Virtual Agent allows you to display bot responses as formatted text within a topic. This functionality supports rich text formatting such as bold, italics, links, bulleted and numbered lists, and emojis to enhance user interaction. It enables you to create dynamic and engaging responses, including inserting script-generated content like temporary passwords or personalized greetings.

    Show full answer Show less

    Key Features

    • Response Message: Supports rich text and scripting with Glide record or script variables, enabling personalized and dynamic content.
    • Text Formatting: Easily format text using editor controls, including creating links with static or dynamic URLs using the data pill picker.
    • Alternate Messages: Add multiple alternate responses so Virtual Agent can randomly select different replies to improve conversation variety.
    • Advanced Options:
      • Shorten Responses: Automatically truncates long responses with a “Show more” link for better user experience (enabled by default).
      • Secure Responses: Masks sensitive information after display to protect user privacy.
      • Request Feedback: Enables thumbs up/down icons for users to provide feedback on bot replies.
      • Conditional Display: Use no-code conditions or low-code scripts to control when a response node is shown in the conversation.
    • Channel Support: Fully supported across major channels like Web UI, Mobile UI, Microsoft Teams, Slack, Workplace, Twilio SMS, LINE, WhatsApp, Apple Messages for Business, and Alexa (with voice-read header on nonscreen devices). Facebook Messenger supports only plain text.
    • Scripting Examples: You can use JavaScript to generate personalized greetings or lists with Markdown-formatted links within responses.

    Practical Benefits for ServiceNow Customers

    • Create engaging, personalized conversations with users by leveraging dynamic scripting and rich text formatting in Virtual Agent responses.
    • Improve user experience by presenting concise messages with expandable details and enabling user feedback.
    • Maintain security and privacy by masking sensitive responses after they are shown.
    • Control response visibility with conditional logic to tailor conversations based on user context or data.
    • Deliver consistent bot experiences across multiple communication channels, ensuring broad user accessibility.

    Use the Text bot response control in a Virtual Agent topic to display a bot response as text. You can format the Text bot responses using the text editor controls. For example, you can bold or italicize the text, as well as include links, bulleted lists, and emojis.

    Text bot response properties

    Use the Text response properties panel to design bot responses to the user.

    Bot text response properties.

    Table 1. General options
    Property Description
    Node name Name that identifies this Text bot response node in the topic flow.
    Response message The Text bot response to the user. The response can be one of the following:
    • Rich text message.
    • Script, which can include Glide record variables or script variables.
      Note:
      The script can also include a temporary password for the end user.

    You can format the text messages using the text editor controls. For example, you can use the icons on the Response Message field to bold or italicize the text, as well as include links, bulleted lists, numbered lists, and emojis.

    Text bot response message options: Open an incident in the Support Portal, or call for immediate assistance.

    You can also include an input variable, such as a temporary password, in the response message.

    Temporary password text response message.

    To include a link, do one of the following:
    • Select the link icon: Link icon..
    • Add your response message. Select the text to use as a link, and then select the link icon.

    Fill in the fields in the Confirmation window. Enter the text to use as the link, and then enter the URL in the Link field.

    Enter the display label for the link and a static URL, or use the data pill picker to create a dynamic URL.

    Add alternate message Add one or more alternate response messages for the user. Virtual Agent randomly chooses one of your responses for each conversation.

    Three defined alternate response messages: "User, sounds great," "Excellent choice," and "Let's proceed with Chosen Option, then."

    Table 2. Advanced options
    Shorten responses
    Enable When turned on, long bot responses are shortened. A Show more link is shown along with the truncated response. When the option is turned off, the entire response is used. By default, this option is turned on.
    Make this response secure
    Enable When enabled, the bot response is displayed to the user, but thereafter securely masked and not viewable by others.
    Request feedback
    Enable When turned on, thumbs up and down icons are displayed next to bot responses for feedback.
    Hide this node
    Conditionally show this node if

    A no-code condition statement or low-code script that specifies a condition for presenting this node in the conversation. The condition must evaluate to true.

    Channel support

    Table 3. Channel support for the Text bot response control
    Channel Support Constraints
    Web UI Supported None
    Mobile UI Supported None
    Now Assist panel Supported None
    Microsoft Teams Supported None
    Slack Supported None
    Workplace Supported None
    Facebook Messenger Supported Plain text string only
    SMS Twilio Supported None
    LINE Supported None
    WhatsApp Supported None
    Apple Messages for Business Supported None
    Alexa (Voice) Supported For screen devices, full support. For nonscreen devices, the header is read.

    Example Text bot response script

    In this example, the script returns a string that greets the user. The gs.getUser().getFirstName() property is used to append the first name of the current user.

    (function execute() {
        return 'Hello ' + gs.getUser().getFirstName();
    })()

    In this example, the script returns links to three instances in the response. Use Markdown to include multiple links in the script.

    (function execute() {
        var output = 'Hello\n';
        output += '\n- [Instance 1](http://instance1.com)';
        output += '\n- [Instance 2](http://instance2.com)';
        output += '\n- [Instance 3](http://instance3.com)';
        return output;
    })()

    Example Text bot response control

    Note:
    Virtual Agent Designer controls may display and function differently in other channels.
    Response properties Text bot response output
    Figure 1. Text bot response control basic properties
    Basic properties include the node name and a rich text response message area.
    Figure 2. Web UI Text bot response output
    Text response with emojis that reads, "We could not find any assets currently assigned to you." A phone number, additional steps, and a link are included.