{"id":19909,"date":"2019-05-02T11:33:46","date_gmt":"2019-05-02T11:33:46","guid":{"rendered":"https:\/\/developer.kore.ai\/v8-1\/?p=19909"},"modified":"2021-01-04T10:24:59","modified_gmt":"2021-01-04T10:24:59","slug":"working-with-the-message-nodes","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v8-1\/docs\/bots\/bot-builder-tool\/dialog-task\/working-with-the-message-nodes\/","title":{"rendered":"Working with the Message (Bot Response) Nodes"},"content":{"rendered":"<section class=\"l-section wpb_row height_auto\"><div class=\"l-section-h i-cf\"><div class=\"g-cols vc_row type_default valign_top\"><div class=\"vc_col-sm-12 wpb_column vc_column_container\"><div class=\"vc_column-inner\"><div class=\"wpb_wrapper\">\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<p>The Message Node is used to deliver a message to the user. Message nodes commonly follow an API, web service call, or webhook event to define their results as a formatted response.<br \/>\nYou can format bot responses as below:<\/p>\n<ul>\n<li><b>Plain text<\/b>: Type a message in plain text. You can use stored context values with <code>{{variable brackets}}<\/code>. For example: <code>'Hello {{context.session.UserContext.firstName}}. How can I help you?'<\/code><\/li>\n<li><b>Javascript<\/b>: Compose JavaScript responses either:\n<ul>\n<li>For dynamically constructing messages using context and session variables.<\/li>\n<li>for displaying templates or widgets as supported by various channels.<br \/>\nFor example, you can compose a JavaScript message for Facebook Channel to present a Carousel template.<\/li>\n<li>Optionally, you can generate links to view the information in an HTML report format using templates and share the URL with the bot message.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>For example, the <i>Book Flights<\/i> sample dialog uses the following message nodes:<\/p>\n<ul>\n<li><i><strong>WeatherReport<\/strong>: <\/i>This <i>s<\/i>hows the weather details returned by the <i>WeatherApi<\/i> Service node, formatted using the <i>LocationScript<\/i> node.<\/li>\n<li><i><strong>FinalFlightinfo<\/strong><\/i>: This shows the flight itineraries that the <i>Flights info <\/i>service node returns.<\/li>\n<li><i><strong>Thanks<\/strong>: <\/i>After showing the final flight details, prompts the user if they have any other request.<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Set_up_a_Message_Node\">Set up a Message Node<\/span><\/h2>\n<p>Setting up a Message node in a dialog task involves the following steps.<\/p>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h3><span class=\"ez-toc-section\" id=\"Add_a_Message_Node_to_the_Dialog_Task\">Add a Message Node to the Dialog Task<\/span><\/h3>\n<ol>\n<li>Open the Dialog Task in which you want to add the Message node.<\/li>\n<li>Click the <img loading=\"lazy\" decoding=\"async\" class=\"icon alignnone wp-image-9160\" src=\"\/wp-content\/uploads\/sites\/18\/DIYDialogTaskPlusIcon.png\" alt=\"diydialogtaskplusicon\" width=\"15\" height=\"15\" \/> icon next to the respective node.<\/li>\n<li>Select <b>Message <\/b>&gt; <b>New message node<\/b>. You can also select an existing message node from the list.<\/li>\n<li>The Message window is displayed with the <strong>Component Properties<\/strong> tab selected by default.<br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/18\/Navigation-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-13920\" src=\"\/wp-content\/uploads\/sites\/18\/Navigation-2.png\" alt=\"\" width=\"643\" height=\"306\" \/><\/a><\/li>\n<\/ol>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h3><span class=\"ez-toc-section\" id=\"Configure_the_Bot_Response\">Configure the Bot Response<\/span><\/h3>\n<div class=\"aler alert-info\"><b>Note<\/b>: The configurations you set up or edit in this section reflect in all other dialog tasks that use this node.<\/div>\n<ol>\n<li class=\"aler alert-info\">On the <strong>Component Properties<\/strong> tab, under the <strong>General Settings<\/strong> section, enter a <strong>Name<\/strong> and <strong>Display Name<\/strong> for the message node.<\/li>\n<li class=\"aler alert-info\">Under the <strong>Bot Responses<\/strong> section, compose and format the bot response either as plain text or as a JavaScript message. A default message is set by the platform, you can customize it in the following ways:\n<ul>\n<li>Edit the message directly and click <strong>Enter<\/strong>. The message is saved in plain text format.<\/li>\n<li class=\"aler alert-info\">Click <b>Manage Responses<\/b>. On the Bot Responses page:\n<ul>\n<li class=\"aler alert-info\">To edit the default sample message by adding context object variables or javascript code, click the sample message and make changes.<\/li>\n<li class=\"aler alert-info\">To add a new bot response, click <b>Add Bot Response<\/b>.<\/li>\n<li class=\"aler alert-info\">On the New Prompt Message window, in the <b>Channel <\/b>drop-down list,<b> All Channels<\/b> is selected by default.<\/li>\n<li class=\"aler alert-info\">To create a channel-specific message, select the channel from the list.<\/li>\n<li class=\"aler alert-info\">In the Message Editor, the <b>Plain Text <\/b>tab is the default selection. If you want to compose a Javascript message, click the <b>JavaScript <\/b>tab.<br \/>\n<strong>Note<\/strong>: You can use any value that is currently stored in the context. For example, <code>print('Hello'+ context.session.UserContext.firstName+ '. How can I help you')<\/code><br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/18\/prompt-message.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-13921\" src=\"\/wp-content\/uploads\/sites\/18\/prompt-message.png\" alt=\"\" width=\"1013\" height=\"408\" \/><\/a><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul>\n<li>Compose the message and click <b>Save<\/b>.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>To add more bot responses, follow the below steps:<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Generate_Message_as_Report_Link_Optional\">Generate Message as Report Link (Optional)<\/span><\/h3>\n<p>The Message node allows you to generate links to view the information in an HTML report format using templates. The URL link is added to the bot message. When you add a link to a bot response, the users can select the link and get more details, such as a table of values for <i>Closed Sales Opportunities<\/i> in the <i>SalesForce<\/i> Bot.<br \/>\nTo generate a report link, follow the below steps:<\/p>\n<ol>\n<li>On the <strong>Component Properties<\/strong> tab, under the <strong>Report URL<\/strong> section, click <b>Generate Report <\/b><strong>Link<\/strong>.<br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/18\/Report-URL.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-13923\" src=\"\/wp-content\/uploads\/sites\/18\/Report-URL.png\" alt=\"\" width=\"468\" height=\"117\" \/><\/a><\/li>\n<li>On the Generate Report dialog box, enter the following values:\n<ul>\n<li><b>Link Title<\/b> \u2013 The link text displayed in the bot channel. For example, <i>View Shopping Cart<\/i>.<\/li>\n<li><b>Header<\/b> \u2013 The title of the report. For example, <i>These are the items in your Shopping Cart<\/i>.<\/li>\n<li><b>Details<\/b> \u2013 End-user help information displayed directly below the header, describing the content of the report. For example, <i>Review your Shopping Cart<\/i>, <i>and then click Continue when you are ready to place your order.<\/i><\/li>\n<li><strong>Data Path<\/strong> &#8211; Path for the data, usually the response from the web service. For example,\u00a0<em>context.ShoppingCartService.response.body<\/em><\/li>\n<li><b>Template<\/b> \u2013 Select one of the following format templates to display the data from the task response. For each type, define the <b>Column Name<\/b>, <b>Key Mapping<\/b>, <b>Data Type<\/b>, and template-specific options.\n<ul>\n<li><b>Table<\/b> &#8211; Uses a table format with defined columns. Each mapping for the <b>Table<\/b> template is set to <b>Is Sortable<\/b>, <b>Display as an image<\/b>, and <b>Display it as a link<\/b>. For more information, refer to <a href=\"\/v8-1\/docs\/bots\/bot-builder-tool\/develop\/simple-task\/information-tasks\/defining-a-table-report\/\">Defining a Table Report<\/a>.<\/li>\n<li><b>Fixed Column Table<\/b> &#8211; Uses a table format with one or more columns fixed. Each mapping for the <b>Fixed Column Table<\/b> template is set to <b>Is Sortable<\/b>, <b>Column in fixed<\/b>, <b>Display as an image<\/b>, and <b>Display it as a link<\/b>. For more information, refer to <a href=\"\/v8-1\/docs\/bots\/bot-builder-tool\/develop\/simple-task\/information-tasks\/defining-a-fixed-column-table-report\/\">Defining a Fixed-Column Table Report<\/a>.<\/li>\n<li><b>Card Layout<\/b> &#8211; Uses a contact card format. Each mapping for the <b>Card Layout<\/b> template is set to <b>Is Sortable<\/b>, <b>Display as an image<\/b>, and <b>Display it as a link<\/b>. For more information, refer to <a href=\"\/v8-1\/docs\/bots\/bot-builder-tool\/develop\/simple-task\/information-tasks\/defining-a-card-layout-report\/\">Defining a Card Layout Report<\/a>.<\/li>\n<li><b>Weather Info<\/b> &#8211; Define a date for a weather service response payload. Each mapping for the <b>Weather Info<\/b> template is set to <b>Is Sortable<\/b>, <b>Display as an image<\/b>, and <b>Display it as a link<\/b>. For more information, refer to <a href=\"\/v8-1\/docs\/bots\/bot-builder-tool\/develop\/simple-task\/information-tasks\/defining-a-weather-info-report\/\">Defining a Weather Info Report<\/a>.<\/li>\n<li><b>Card Layout with Group By<\/b> \u2013 Shows a list of items grouped by a specific field. For more information, refer to <a href=\"\/v8-1\/docs\/bots\/bot-builder-tool\/develop\/simple-task\/information-tasks\/define-a-card-layout-with-group-by-report\/\">Define a Card Layout with Group By Report<\/a>.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>Click <strong>Save<\/strong>.<\/li>\n<\/ol>\n<h3><span class=\"ez-toc-section\" id=\"Configure_the_Variable_Namespace\">Configure the Variable Namespace<\/span><\/h3>\n<p>(introduced in v8.0)<\/p>\n<ul>\n<li>In the <strong>Variable Namespaces<\/strong> section, associate the variable namespaces to execute this node and its transitions. This option is visible only when the Variable Namespace is enabled for the bot. You can go with the task level settings or customize it for this node. For more information, refer to <a href=\"\/v8-1\/docs\/bots\/bot-settings\/bot-management\/managing-namespace\/\" target=\"_blank\" rel=\"noopener noreferrer\">Managing Namespace<\/a>.<\/li>\n<\/ul>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h3><span class=\"ez-toc-section\" id=\"Configure_the_Instance_Properties\">Configure the Instance Properties<\/span><\/h3>\n<ol>\n<li>On the Message window, click the <strong>Instance Properties<\/strong> tab.<\/li>\n<li>Under the <strong>Interruptions Behavior<\/strong> section, you can configure the interruptions behavior for this node.<br \/>\n<b>Note:<\/b> The settings in the Instance Properties tab are specific to the current task and do not reflect in other dialog tasks that use this entity node.<\/p>\n<ul>\n<li><strong> Use the task level \u2018Interruptions Behavior\u2019 setting<\/strong>: The bot refers to the Interruptions Behavior settings set at the dialog task level.<\/li>\n<li><b>Customize for this node option:<\/b> You can customize the Interruptions Behavior settings for this node by selecting this option and configuring the same. Refer to <a href=\"\/v8-1\/docs\/bots\/bot-builder-tool\/train-nlp-optimization\/bot-intelligence\/interruption-handling-context-switching-intents\/\" target=\"_blank\" rel=\"noopener noreferrer\">Interruption Handling and Context Switching<\/a> article for more information.<\/li>\n<\/ul>\n<\/li>\n<li>Under the <strong>Custom Tags<\/strong> section, add tags to build custom profiles of your bot conversations. <a href=\"\/v8-1\/docs\/bots\/bot-builder-tool\/dialog-task\/custom-meta-tags\/\">Click here for more<\/a>.<\/li>\n<\/ol>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h3><span class=\"ez-toc-section\" id=\"Configure_the_Connections_Properties\">Configure the Connections Properties<\/span><\/h3>\n<p>From the node\u2019s <strong>Connections<\/strong> tab, you can determine the node in the dialog task to execute next. You can write the conditional statements based on the values of any Entity or Context Objects in the dialog task, or you can use intents for transitions.<br \/>\nTo setup Component Transitions, follow these steps:<\/p>\n<ol>\n<li>On the Message window, click the <strong>Connections<\/strong> tab.<\/li>\n<li>On the <strong>Connections<\/strong> tab, under the <strong>Connection Rules<\/strong> section, you can select nodes from the <strong>Default<\/strong> drop-down list.<\/li>\n<li>To configure a conditional flow, click <b>Add IF<\/b>.<\/li>\n<li>Configure the conditional expression based on one of the following criteria:\n<ul>\n<li><b>Entity<\/b>: Compare an entity node in the dialog with a specific value using one of these operators: Exists, equals to, greater than equals to, less than equals to, not equal to, greater than, and less than. Select the entity, operator using the respective drop-down lists, and type the number in the <b>Value <\/b>box. For example, <i>PassengerCount (entity) greater than (operator) 5 (specified value).<\/i><\/li>\n<li><b>Context<\/b>: Compare a context object in the dialog with a specific value using one of these operators: Exists, equals to, greater than equals to, less than equals to, not equal to, greater than, and less than. For example,<b>\u00a0<\/b><i>Context.entity.PassengerCount<\/i> <i>(Context object) greater than (operator) 5 (specified value).<\/i><\/li>\n<li><b>Intent: <\/b>Select an intent that matches the next user utterance.<\/li>\n<\/ul>\n<\/li>\n<li>In the <b>Then go to<\/b> drop-down list, select the next node to execute in the dialog flow if the conditional expression succeeds. For example, if the <i>PassengerCount (entity) greater than (operator) 5 (specified value), <\/i><b>Then go to <\/b><i>Offers (sub-dialog).<\/i><\/li>\n<li>In the <b>Else <\/b>drop-down list, select the node to execute if the condition fails.<\/li>\n<\/ol>\n<div class=\"alert alert-info\"><b>Note:<\/b> If you want to write multiple <em>If<\/em> conditions, click <strong>Add Else If<\/strong> below the last <em>If<\/em> conditional expression.<\/div>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h3><span class=\"ez-toc-section\" id=\"Configure_the_IVR_Properties\">Configure the IVR Properties<\/span><\/h3>\n<p>You can use this tab to define the input mode, grammar, prompts, and call behavior parameters for this node to use in IVR Channel. It is done at the node level. <a href=\"\/v8-1\/docs\/bots\/advanced-topics\/ivr-integration\/ivr-integration\/#ivr-settings-field-reference\">Click here for details<\/a><\/p>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<div class=\"w-post-elm post_navigation layout_simple inv_false\">\n\t<a class=\"post_navigation-item order_first to_prev\" href=\"https:\/\/developer.kore.ai\/v8-1\/v8-1\/docs\/bots\/bot-builder-tool\/dialog-task\/working-with-the-logic-node\/\"><\/p>\n<div class=\"post_navigation-item-arrow\"><\/div>\n<div class=\"post_navigation-item-meta\">Previous<\/div>\n<div class=\"post_navigation-item-title\"><span>Logic Node<\/span><\/div>\n<p>\t<\/a><br \/>\n<a class=\"post_navigation-item order_second to_next\" href=\"https:\/\/developer.kore.ai\/v8-1\/v8-1\/docs\/bots\/bot-builder-tool\/dialog-task\/working-with-the-confirmation-nodes\/\"><\/p>\n<div class=\"post_navigation-item-arrow\"><\/div>\n<div class=\"post_navigation-item-meta\">Next<\/div>\n<div class=\"post_navigation-item-title\"><span>Confirmation Nodes<\/span><\/div>\n<p>\t<\/a><\/div>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div><\/div><\/div><\/div><\/div><\/div><\/section>\n","protected":false},"excerpt":{"rendered":"The Message Node is used to deliver a message to the user. Message nodes commonly follow an API, web service call, or webhook event to define their results as a formatted response. You can format bot responses as below: Plain text: Type a message in plain text. You can use stored context values with {{variable...","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29],"tags":[],"class_list":["post-19909","post","type-post","status-publish","format-standard","hentry","category-dialog-task"],"_links":{"self":[{"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/posts\/19909","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/comments?post=19909"}],"version-history":[{"count":10,"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/posts\/19909\/revisions"}],"predecessor-version":[{"id":26355,"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/posts\/19909\/revisions\/26355"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/media?parent=19909"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/categories?post=19909"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/tags?post=19909"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}