Product documentation Docs
    • English
    • Deutsch
    • 日本語
    • 한국어
    • Français
  • More Sites
    • Now Community
    • Developer Site
    • Knowledge Base
    • Product Information
    • ServiceNow.com
    • Training
    • Customer Success Center
    • ServiceNow Support Videos
  • Log in

Product documentation

  • Home
How search works:
  • Punctuation and capital letters are ignored
  • Special characters like underscores (_) are removed
  • Known synonyms are applied
  • The most relevant topics (based on weighting and matching to search terms) are listed first in search results
Topics are ranked in search results by how closely they match your search terms
  • A match on the entire phrase you typed
  • A match on part of the phrase you typed
  • A match on ALL of the terms in the phrase you typed
  • A match on ANY of the terms in the phrase you typed

Note: Matches in titles are always highly ranked.

  • Release version
    Table of Contents
    • Analytics, Intelligence, and Reporting
Table of Contents
Choose your release version
    Home Paris Analytics, Intelligence, and Reporting Analytics, Intelligence, and Reporting Virtual Agent Virtual Agent Designer Virtual Agent Designer bot responses

    Virtual Agent Designer bot responses

    • Save as PDF Selected topic Topic & subtopics All topics in contents
    • Unsubscribe Log in to subscribe to topics and get notified when content changes.
    • Share this page

    Virtual Agent Designer bot responses

    Virtual Agent Designer offers various controls for displaying bot responses in a conversation. Because the bot responses occur in third-party platforms, the format for each output may vary.

    Text bot response control

    Use the Text bot response control in a Virtual Agent topic to display a text bot response.

    Example Text bot response control

    Table 1.
    Response properties Text bot response output
    Text bot response control properties
    Figure 1. Web UI Text bot response output
    Text bot response output in the web UI
    Figure 2. Slack Text bot response output
    Text bot response output in Slack
    Figure 3. Microsoft Teams Text bot response output
    Text bot response output in Microsoft Teams
    Figure 4. Workplace Text bot response output
    Text bot response output in Workplace

    Text bot response properties

    Property Description
    Name The name that identifies the Text bot response node in the topic flow.
    Response message The Text bot response to the user, either a text string or a script that returns a text string. The script can include Glide record variables or script variables.
    Condition A script that specifies a condition for presenting this response in the conversation. The condition must return a value of true to display the text.

    Example Text bot response script

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

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

    Image Output bot response control

    Use the Image Output bot response control in a Virtual Agent topic to display an image from a URL link. The image aspect ratio determines how the image is sized in the bot chat bubble.

    Example Image Output bot response control

    Table 2.
    Response properties Image Output bot response output
    Image Output bot response control properties
    Figure 5. Web UI Image Output bot response output
    Image Output bot response output in the web UI
    Figure 6. Slack Image Output bot response output
    Image Output bot response output in Slack
    Figure 7. Microsoft Teams Image Output bot response output
    Image Output bot response output in Microsoft Teams
    Figure 8. Workplace Image Output bot response output
    Image Output bot response in Workplace

    Image Output bot response control properties

    Property Description
    Name Required. The name that identifies the Image Output bot response control node in the topic flow.
    Image URL Link The URL link to an image file.
    Condition A script that specifies a condition for presenting this image in the conversation. The condition must return a value of true to display the image.
    Note: Third-party messaging applications might place restrictions on the maximum size of an image displayed within a conversation. For details on the maximum image size allowed, check the documentation for the messaging application. For example, Microsoft Teams supports a maximum image size of 1024 x 1024 pixels and 1 MB file size for PNG, JPEG, and GIF files. For more information, see the Microsoft Teams Developer documentation on conversations. Note also that sometimes in Microsoft Teams bot conversations, images might not fully render and appear cropped. The user has to scroll up and down in the messaging window to view the image.

    Link bot response control

    Use the Link bot response control in a Virtual Agent topic to present a bot response that contains a header prompt with either a single URL link to an item or multiple URL links for up to three items. For example, you can provide a single link to a website page or to a particular record, such as an incident. Or you can provide multiple links to different items, such as search results.

    Note: If you are using the link bot response control for Virtual Agent conversations on Now mobile apps, web links open in the mobile browser. If you want links to open in a native mobile screen within the mobile app, create deep links for items in your conversation topics. For details on deep linking in mobile apps, see the MobileDeepLinkGenerator - Global API.

    Example single link bot response control

    Table 3.
    Single link bot response properties Link bot response output
    Link bot response control properties
    Figure 9. Web UI Link bot response output
    Link bot response output in the web UI
    Figure 10. Slack Link bot response output
    Link bot response output in Slack
    Figure 11. Microsoft Teams Link bot response output
    Link bot response output in Microsoft Teams
    Figure 12. Workplace Link bot response output
    Link bot response output in Facebook Workplace
    Table 4. Single link properties
    Property Description
    Name Name that identifies the Link bot response control node in the topic flow.
    Link List Type of links returned in the output result:
    • Single Link: Returns one item in the output results.
    • Multiple Links: Returns up to three items in the output results.
    Select Single Link.
    Header Message displayed above the URL link. Can be a string with variables or a script.
    Label Text that identifies a single link in the bot bubble. Can be a string with variables or a script.
    Link Link to a single item, such as a website page or a particular record. Can be a string with variables or a script that returns a valid URL as a string. For example, you can enter the complete URL, such as https://servicenow.com.
    Condition A condition created with the condition builder or a script that specifies a condition for displaying the link.

    Multi-link bot response control properties

    Table 5.
    Multi-link bot response properties Link bot response output
    Link bot response control properties
    Figure 13. Web UI Link bot response output - multiple URL links
    Multi-link bot response output in the web UI
    Note: Multi-link bot output is also supported in Microsoft Teams, Slack, Workplace, and Facebook Messenger.
    Table 6. Multi-link properties
    Property Description
    Name Name that identifies the Link bot response control node in the topic flow.
    Link List Type of links returned in the output result:
    • Single Link: Returns one item in the output results.
    • Multiple Links: Returns up to three items in the output results.
    Select Multiple Links.
    Header Message Text prompt displayed above the list of links. Can be a string with variables or a script.
    URL List Value Expression Script that creates a list of links to display, which includes the following parameters: link URL, link display label, link description, and link context.
    Condition A condition created with the condition builder or a script that specifies a condition for displaying the links.

    HTML bot response control

    Use the HTML bot response control to display static HTML text in the Virtual Agent bot response.

    Note: If you created conversations in the London release that use this bot response control to generate card layouts, consider updating your conversations to use the Card bot response control. The Card displays information from a record in your instance and contains a link to that related record.

    Security considerations for HTML markup

    For security reasons, an HTML sanitizer script runs automatically and checks all HTML output controls in Virtual Agent conversations. The sanitizer script removes elements or attributes that might enable cross-site scripting attacks. You can edit the HTML sanitizer script to change the list of markup items to be preserved or removed. For details, see HTML sanitizer and Configure HTML sanitizer for examples on adding markup items to the exclusion or inclusion lists.

    To disable the HTML sanitizer script only for Virtual Agent conversations, add the com.glide.cs.html.sanitizer.enabled system property and set the value to false. For details on creating a system property, see Add a system property.

    Example HTML bot response output

    The HTML bot response shows a static HTML as a chat response. This example includes an image, headings, and paragraph text. The web UI presents this content as HTML. The Slack, Microsoft Teams, and Workplace user interfaces display the same content as a PNG image. URL links within the HTML are extracted and displayed below the image. The URL can be either an absolute or a relative link. If you use a relative link, it must be relative to the ServiceNow instance.

    Table 7.
    HTML bot response properties HTML bot response output
    HTML bot response control properties
    Figure 14. Web UI HTML output
    HTML output in the web UI
    Figure 15. Slack HTML output
    HTML output in Slack
    Figure 16. Microsoft Teams HTML output
    HTML output in Microsoft Teams
    Figure 17. Workplace HTML output
    HTML output in Workplace

    HTML bot response control properties

    Property Description
    Name Name that identifies the HTML bot response control node in the topic flow.
    HTML Message HTML output to be displayed. Click the Edit icon to open the HTML editor.
    Height (Pixel) Maximum height of the area for displaying HTML output in third-party messaging applications.
    Width (Pixel) Maximum width of the bot bubble for displaying HTML output in third-party messaging applications.
    Note: As shown in the examples, HTML output can vary in third-party messaging applications. Determine an appropriate Height and Width area by setting initial height and width values, previewing the HTML output in the messaging applications you intend to use, and then adjusting the height and width values.

    Multi-flow Output bot response control

    Use the Multi-flow Output bot response control in a Virtual Agent topic to sequentially display two or more outputs (text, image, link, or HTML). Users can move from one output to the next through a provided navigation button.

    Example Multi-flow Output bot response control

    Table 8.
    Output properties Multi-flow Output bot response output
    Multi-flow Output control properties
    Figure 18. Web UI Multi-flow Output bot response output
    Multi-flow Output bot response output in the web UI
    Figure 19. Slack Multi-flow Output bot response output
    Multi-flow Output bot response output in Slack
    Figure 20. Microsoft Teams Multi-flow Output bot response output
    Multi-flow Output bot response output in Microsoft Teams
    Figure 21. Workplace Multi-flow Output bot response output
    Multi-flow Output bot response output in Workplace.

    Multi-flow Output bot response control properties

    Property Description
    Name The name that identifies this Multi-flow Output bot response control node in the topic flow.
    Condition A script that specifies a condition for presenting this output in the conversation. The condition must return a value of true to display the output.
    Response messages
    Navigation Label The label for the button displayed below the output. The button enables the user to move to the next output in the flow.
    Add a response For each output type, click + Add a Response to specify the output and define the output properties.
    1. In the Add a Response dialog box, select the Type, and specify the associated values:
      • Text — Enter the text to be displayed in the response.
      • Image — Enter the Header, Prompt (label for the link), and the URL link to the image.
      • Link — Enter the Header, Prompt (label for the link), and the URL link.
      • HTML — Enter the Height and Width, in pixels, to set the dimensions of the HTML block. In the HTML editor, enter the HTML markup to be displayed.
    2. Click Save.

    Script Output bot response control

    Use Script Output bot response control in a Virtual Agent topic to run a script that returns a single response or a multi-part response.

    Example Script Output bot response control

    Use the Script Output bot response control when creating a more complex response that relies on scripted calculations or requires a multi-part response. Scripted output can include text, image, cards, links, and HTML to create a versatile response.

    Table 9.
    Script Output properties Script Output bot response output
    Script Output bot response control properties
    Figure 22. Web UI Script Output bot response output
    Script Output bot response output in the web UI
    Figure 23. Slack Script Output bot response output
    Script Output bot response output in Slack
    Figure 24. Microsoft Teams Script Output bot response output
    Script Output bot response output in Microsoft Teams
    Figure 25. Workplace Script Output bot response output
    Script Output bot response output in Workplace

    Script Output bot response control properties

    Property Description
    Name The name that identifies the Script Output bot response control node in the topic flow.
    Script Output Type The type of output returned by the script: single-part or multi-part.
    Script Response Message The script that generates the selected output type (single or multi-part).
    Condition A script that specifies a condition for presenting this output in the conversation. The condition must return a value of true to display the output.

    Example script

    (function execute() {
          var gdt = new GlideDateTime();
          var gt = new GlideTime();
          gdt.addSeconds(7200);
          gt = gdt.getTime();
          var multiOutMsg = new sn_cs.MultiPartOutMsg();
          multiOutMsg.addPlainTextPart('Thank you for submitting an incident.');
          multiOutMsg.addPlainTextPart('You should receive a response from a technician by ' + gt.getByFormat('HH:mm'));
          return multiOutMsg;
    })()

    In this example, the script calculates the time two hours from the current time and outputs a multi-part message that includes this information.

    Card bot response control

    Use the Card bot response control in a Virtual Agent topic to display selected information from a record on your instance, such as an incident.

    Note: If you created conversations in the London release that use the HTML bot response control to generate card layouts, consider updating your conversations to use the Card bot response control. The Card displays information from a record in your instance and contains a link to that related record.

    Example Card bot response output

    The Card response shows content from a record in a compact format designed for readability within the chat window. The record content includes the display field for the table at the top of the card followed by any other fields specified by the properties of the bot response.
    Table 10.
    Response properties Card output
    Card control properties
    Figure 26. Web UI Card output
    Card output in the web UI
    Figure 27. Slack Card output
    Card output in Slack
    Figure 28. Microsoft Teams Card output
    Card output in Microsoft Teams
    Figure 29. Workplace Card output
    Card output in Workplace

    The list template in the card layout for Facebook apps no longer supports vertical list templates. The card layout uses a horizontal scrollable carousel template effective August 15, 2019. Cards also feature a button template.

    Card bot response control properties

    The contents of the card must come from a single record on your instance. This record can be referenced from variables in the flow or queried using a script that returns a single Glide record from a selected table. Use the Card control properties to define which record is used and the fields that are displayed from that record.

    Property Description
    Name The name that identifies the Card bot response control node in the topic flow.
    Reference Type The reference to a specific record in a table. Choose one of the following options:
    • Record — Data for the card comes from a record referenced in a variable from another node in the flow, for example, a Choice List or Glide Action.
    • Script — Data for the card comes from a script that returns a single Glide record from a specified table.
    Record

    When the Reference Type property is set to Record, this property appears as a list. Use this list to select a variable from the current flow that contains a record object. Information from this record is shown in the card.

    When the Reference Type field is set to script, use this field to input a script that returns the record. Information from this record is shown in the card.

    Table If the Reference Type is Script, select the table containing the record.
    Fields The fields from the ServiceNow record to be displayed in the card. Click +Add Field to specify each field.
    Note: If you are using Workplace, a maximum of four fields is rendered on the card. If you have more than four fields, the remaining fields are displayed on a subsequent card (up to four fields per card).
    Condition A condition statement or script that specifies a condition for presenting this card in the conversation. The condition must return a value of true to display the card.

    Example Glide record query

    (function execute(table) {
        /* Write a glide record query, and return the glide record.
           For example:
           
           var now_GR = new GlideRecord(table);
           now_GR.addEncodedQuery('active=true^number=INC0010099');
           now_GR.query();
           if(now_GR.next()) {
              return gr;
        }
        */
    })(table)
    

    In this example, the script creates a GlideRecord object, populates this object using a query that should return a single result, then returns the object. The Table property defines the table used in this query.

    Tags:

    Feedback
    On this page

    Previous topic

    Next topic

    • Contact Us
    • Careers
    • Terms of Use
    • Privacy Statement
    • Sitemap
    • © ServiceNow. All rights reserved.

    Release version
    Choose your release version

      Virtual Agent Designer bot responses

      • Save as PDF Selected topic Topic & subtopics All topics in contents
      • Unsubscribe Log in to subscribe to topics and get notified when content changes.
      • Share this page

      Virtual Agent Designer bot responses

      Virtual Agent Designer offers various controls for displaying bot responses in a conversation. Because the bot responses occur in third-party platforms, the format for each output may vary.

      Text bot response control

      Use the Text bot response control in a Virtual Agent topic to display a text bot response.

      Example Text bot response control

      Table 1.
      Response properties Text bot response output
      Text bot response control properties
      Figure 1. Web UI Text bot response output
      Text bot response output in the web UI
      Figure 2. Slack Text bot response output
      Text bot response output in Slack
      Figure 3. Microsoft Teams Text bot response output
      Text bot response output in Microsoft Teams
      Figure 4. Workplace Text bot response output
      Text bot response output in Workplace

      Text bot response properties

      Property Description
      Name The name that identifies the Text bot response node in the topic flow.
      Response message The Text bot response to the user, either a text string or a script that returns a text string. The script can include Glide record variables or script variables.
      Condition A script that specifies a condition for presenting this response in the conversation. The condition must return a value of true to display the text.

      Example Text bot response script

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

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

      Image Output bot response control

      Use the Image Output bot response control in a Virtual Agent topic to display an image from a URL link. The image aspect ratio determines how the image is sized in the bot chat bubble.

      Example Image Output bot response control

      Table 2.
      Response properties Image Output bot response output
      Image Output bot response control properties
      Figure 5. Web UI Image Output bot response output
      Image Output bot response output in the web UI
      Figure 6. Slack Image Output bot response output
      Image Output bot response output in Slack
      Figure 7. Microsoft Teams Image Output bot response output
      Image Output bot response output in Microsoft Teams
      Figure 8. Workplace Image Output bot response output
      Image Output bot response in Workplace

      Image Output bot response control properties

      Property Description
      Name Required. The name that identifies the Image Output bot response control node in the topic flow.
      Image URL Link The URL link to an image file.
      Condition A script that specifies a condition for presenting this image in the conversation. The condition must return a value of true to display the image.
      Note: Third-party messaging applications might place restrictions on the maximum size of an image displayed within a conversation. For details on the maximum image size allowed, check the documentation for the messaging application. For example, Microsoft Teams supports a maximum image size of 1024 x 1024 pixels and 1 MB file size for PNG, JPEG, and GIF files. For more information, see the Microsoft Teams Developer documentation on conversations. Note also that sometimes in Microsoft Teams bot conversations, images might not fully render and appear cropped. The user has to scroll up and down in the messaging window to view the image.

      Link bot response control

      Use the Link bot response control in a Virtual Agent topic to present a bot response that contains a header prompt with either a single URL link to an item or multiple URL links for up to three items. For example, you can provide a single link to a website page or to a particular record, such as an incident. Or you can provide multiple links to different items, such as search results.

      Note: If you are using the link bot response control for Virtual Agent conversations on Now mobile apps, web links open in the mobile browser. If you want links to open in a native mobile screen within the mobile app, create deep links for items in your conversation topics. For details on deep linking in mobile apps, see the MobileDeepLinkGenerator - Global API.

      Example single link bot response control

      Table 3.
      Single link bot response properties Link bot response output
      Link bot response control properties
      Figure 9. Web UI Link bot response output
      Link bot response output in the web UI
      Figure 10. Slack Link bot response output
      Link bot response output in Slack
      Figure 11. Microsoft Teams Link bot response output
      Link bot response output in Microsoft Teams
      Figure 12. Workplace Link bot response output
      Link bot response output in Facebook Workplace
      Table 4. Single link properties
      Property Description
      Name Name that identifies the Link bot response control node in the topic flow.
      Link List Type of links returned in the output result:
      • Single Link: Returns one item in the output results.
      • Multiple Links: Returns up to three items in the output results.
      Select Single Link.
      Header Message displayed above the URL link. Can be a string with variables or a script.
      Label Text that identifies a single link in the bot bubble. Can be a string with variables or a script.
      Link Link to a single item, such as a website page or a particular record. Can be a string with variables or a script that returns a valid URL as a string. For example, you can enter the complete URL, such as https://servicenow.com.
      Condition A condition created with the condition builder or a script that specifies a condition for displaying the link.

      Multi-link bot response control properties

      Table 5.
      Multi-link bot response properties Link bot response output
      Link bot response control properties
      Figure 13. Web UI Link bot response output - multiple URL links
      Multi-link bot response output in the web UI
      Note: Multi-link bot output is also supported in Microsoft Teams, Slack, Workplace, and Facebook Messenger.
      Table 6. Multi-link properties
      Property Description
      Name Name that identifies the Link bot response control node in the topic flow.
      Link List Type of links returned in the output result:
      • Single Link: Returns one item in the output results.
      • Multiple Links: Returns up to three items in the output results.
      Select Multiple Links.
      Header Message Text prompt displayed above the list of links. Can be a string with variables or a script.
      URL List Value Expression Script that creates a list of links to display, which includes the following parameters: link URL, link display label, link description, and link context.
      Condition A condition created with the condition builder or a script that specifies a condition for displaying the links.

      HTML bot response control

      Use the HTML bot response control to display static HTML text in the Virtual Agent bot response.

      Note: If you created conversations in the London release that use this bot response control to generate card layouts, consider updating your conversations to use the Card bot response control. The Card displays information from a record in your instance and contains a link to that related record.

      Security considerations for HTML markup

      For security reasons, an HTML sanitizer script runs automatically and checks all HTML output controls in Virtual Agent conversations. The sanitizer script removes elements or attributes that might enable cross-site scripting attacks. You can edit the HTML sanitizer script to change the list of markup items to be preserved or removed. For details, see HTML sanitizer and Configure HTML sanitizer for examples on adding markup items to the exclusion or inclusion lists.

      To disable the HTML sanitizer script only for Virtual Agent conversations, add the com.glide.cs.html.sanitizer.enabled system property and set the value to false. For details on creating a system property, see Add a system property.

      Example HTML bot response output

      The HTML bot response shows a static HTML as a chat response. This example includes an image, headings, and paragraph text. The web UI presents this content as HTML. The Slack, Microsoft Teams, and Workplace user interfaces display the same content as a PNG image. URL links within the HTML are extracted and displayed below the image. The URL can be either an absolute or a relative link. If you use a relative link, it must be relative to the ServiceNow instance.

      Table 7.
      HTML bot response properties HTML bot response output
      HTML bot response control properties
      Figure 14. Web UI HTML output
      HTML output in the web UI
      Figure 15. Slack HTML output
      HTML output in Slack
      Figure 16. Microsoft Teams HTML output
      HTML output in Microsoft Teams
      Figure 17. Workplace HTML output
      HTML output in Workplace

      HTML bot response control properties

      Property Description
      Name Name that identifies the HTML bot response control node in the topic flow.
      HTML Message HTML output to be displayed. Click the Edit icon to open the HTML editor.
      Height (Pixel) Maximum height of the area for displaying HTML output in third-party messaging applications.
      Width (Pixel) Maximum width of the bot bubble for displaying HTML output in third-party messaging applications.
      Note: As shown in the examples, HTML output can vary in third-party messaging applications. Determine an appropriate Height and Width area by setting initial height and width values, previewing the HTML output in the messaging applications you intend to use, and then adjusting the height and width values.

      Multi-flow Output bot response control

      Use the Multi-flow Output bot response control in a Virtual Agent topic to sequentially display two or more outputs (text, image, link, or HTML). Users can move from one output to the next through a provided navigation button.

      Example Multi-flow Output bot response control

      Table 8.
      Output properties Multi-flow Output bot response output
      Multi-flow Output control properties
      Figure 18. Web UI Multi-flow Output bot response output
      Multi-flow Output bot response output in the web UI
      Figure 19. Slack Multi-flow Output bot response output
      Multi-flow Output bot response output in Slack
      Figure 20. Microsoft Teams Multi-flow Output bot response output
      Multi-flow Output bot response output in Microsoft Teams
      Figure 21. Workplace Multi-flow Output bot response output
      Multi-flow Output bot response output in Workplace.

      Multi-flow Output bot response control properties

      Property Description
      Name The name that identifies this Multi-flow Output bot response control node in the topic flow.
      Condition A script that specifies a condition for presenting this output in the conversation. The condition must return a value of true to display the output.
      Response messages
      Navigation Label The label for the button displayed below the output. The button enables the user to move to the next output in the flow.
      Add a response For each output type, click + Add a Response to specify the output and define the output properties.
      1. In the Add a Response dialog box, select the Type, and specify the associated values:
        • Text — Enter the text to be displayed in the response.
        • Image — Enter the Header, Prompt (label for the link), and the URL link to the image.
        • Link — Enter the Header, Prompt (label for the link), and the URL link.
        • HTML — Enter the Height and Width, in pixels, to set the dimensions of the HTML block. In the HTML editor, enter the HTML markup to be displayed.
      2. Click Save.

      Script Output bot response control

      Use Script Output bot response control in a Virtual Agent topic to run a script that returns a single response or a multi-part response.

      Example Script Output bot response control

      Use the Script Output bot response control when creating a more complex response that relies on scripted calculations or requires a multi-part response. Scripted output can include text, image, cards, links, and HTML to create a versatile response.

      Table 9.
      Script Output properties Script Output bot response output
      Script Output bot response control properties
      Figure 22. Web UI Script Output bot response output
      Script Output bot response output in the web UI
      Figure 23. Slack Script Output bot response output
      Script Output bot response output in Slack
      Figure 24. Microsoft Teams Script Output bot response output
      Script Output bot response output in Microsoft Teams
      Figure 25. Workplace Script Output bot response output
      Script Output bot response output in Workplace

      Script Output bot response control properties

      Property Description
      Name The name that identifies the Script Output bot response control node in the topic flow.
      Script Output Type The type of output returned by the script: single-part or multi-part.
      Script Response Message The script that generates the selected output type (single or multi-part).
      Condition A script that specifies a condition for presenting this output in the conversation. The condition must return a value of true to display the output.

      Example script

      (function execute() {
            var gdt = new GlideDateTime();
            var gt = new GlideTime();
            gdt.addSeconds(7200);
            gt = gdt.getTime();
            var multiOutMsg = new sn_cs.MultiPartOutMsg();
            multiOutMsg.addPlainTextPart('Thank you for submitting an incident.');
            multiOutMsg.addPlainTextPart('You should receive a response from a technician by ' + gt.getByFormat('HH:mm'));
            return multiOutMsg;
      })()

      In this example, the script calculates the time two hours from the current time and outputs a multi-part message that includes this information.

      Card bot response control

      Use the Card bot response control in a Virtual Agent topic to display selected information from a record on your instance, such as an incident.

      Note: If you created conversations in the London release that use the HTML bot response control to generate card layouts, consider updating your conversations to use the Card bot response control. The Card displays information from a record in your instance and contains a link to that related record.

      Example Card bot response output

      The Card response shows content from a record in a compact format designed for readability within the chat window. The record content includes the display field for the table at the top of the card followed by any other fields specified by the properties of the bot response.
      Table 10.
      Response properties Card output
      Card control properties
      Figure 26. Web UI Card output
      Card output in the web UI
      Figure 27. Slack Card output
      Card output in Slack
      Figure 28. Microsoft Teams Card output
      Card output in Microsoft Teams
      Figure 29. Workplace Card output
      Card output in Workplace

      The list template in the card layout for Facebook apps no longer supports vertical list templates. The card layout uses a horizontal scrollable carousel template effective August 15, 2019. Cards also feature a button template.

      Card bot response control properties

      The contents of the card must come from a single record on your instance. This record can be referenced from variables in the flow or queried using a script that returns a single Glide record from a selected table. Use the Card control properties to define which record is used and the fields that are displayed from that record.

      Property Description
      Name The name that identifies the Card bot response control node in the topic flow.
      Reference Type The reference to a specific record in a table. Choose one of the following options:
      • Record — Data for the card comes from a record referenced in a variable from another node in the flow, for example, a Choice List or Glide Action.
      • Script — Data for the card comes from a script that returns a single Glide record from a specified table.
      Record

      When the Reference Type property is set to Record, this property appears as a list. Use this list to select a variable from the current flow that contains a record object. Information from this record is shown in the card.

      When the Reference Type field is set to script, use this field to input a script that returns the record. Information from this record is shown in the card.

      Table If the Reference Type is Script, select the table containing the record.
      Fields The fields from the ServiceNow record to be displayed in the card. Click +Add Field to specify each field.
      Note: If you are using Workplace, a maximum of four fields is rendered on the card. If you have more than four fields, the remaining fields are displayed on a subsequent card (up to four fields per card).
      Condition A condition statement or script that specifies a condition for presenting this card in the conversation. The condition must return a value of true to display the card.

      Example Glide record query

      (function execute(table) {
          /* Write a glide record query, and return the glide record.
             For example:
             
             var now_GR = new GlideRecord(table);
             now_GR.addEncodedQuery('active=true^number=INC0010099');
             now_GR.query();
             if(now_GR.next()) {
                return gr;
          }
          */
      })(table)
      

      In this example, the script creates a GlideRecord object, populates this object using a query that should return a single result, then returns the object. The Table property defines the table used in this query.

      Tags:

      Feedback

          Share this page

          Got it! Feel free to add a comment
          To share your product suggestions, visit the Idea Portal.
          Please let us know how to improve this content

          Check any that apply

          To share your product suggestions, visit the Idea Portal.
          Confirm

          We were unable to find "Coaching" in Jakarta. Would you like to search instead?

          No Yes
          • Contact Us
          • Careers
          • Terms of Use
          • Privacy Statement
          • Sitemap
          • © ServiceNow. All rights reserved.

          Subscribe Subscribed Unsubscribe Last updated: Tags: January February March April May June July August September October November December No Results Found Versions Search preferences successfully updated My release version successfully updated My release version successfully deleted An error has occurred. Please try again later. You have been unsubscribed from all topics. You are now subscribed to and will receive notifications if any changes are made to this page. You have been unsubscribed from this content Thank you for your feedback. Form temporarily unavailable. Please try again or contact  docfeedback@servicenow.com  to submit your comments. The topic you requested does not exist in the release. You were redirected to a related topic instead. The available release versions for this topic are listed There is no specific version for this documentation. Explore products Click to go to the page. Release notes and upgrades Click to open the dropdown menu. Delete Remove No selected version Reset This field is required You are already subscribed to this topic Attach screenshot The file you uploaded exceeds the allowed file size of 20MB. Please try again with a smaller file. Please complete the reCAPTCHA step to attach a screenshot
          Log in to personalize your search results and subscribe to topics
          No, thanks Login