{"id":19909,"date":"2019-05-02T11:33:46","date_gmt":"2019-05-02T11:33:46","guid":{"rendered":"https:\/\/developer.kore.ai\/?p=19909"},"modified":"2021-08-04T07:29:04","modified_gmt":"2021-08-04T06:29:04","slug":"working-with-the-message-nodes","status":"publish","type":"post","link":"https:\/\/multisite.korebots.com\/v9-0\/docs\/bots\/bot-builder-tool\/dialog-task\/working-with-the-message-nodes\/","title":{"rendered":"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 via_grid cols_1 laptops-cols_inherit tablets-cols_inherit mobiles-cols_1 valign_top type_default stacking_default\"><div class=\"wpb_column vc_column_container\"><div class=\"vc_column-inner\"><div class=\"wpb_text_column\"><div class=\"wpb_wrapper\"><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 requests.<\/li>\n<\/ul>\n<\/div><\/div><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 class=\"wpb_text_column\"><div class=\"wpb_wrapper\"><h2><span class=\"ez-toc-section\" id=\"Set-Up\"><\/span>Set-Up<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Setting up a Message node in a dialog task involves the following steps:<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Add_Node\"><\/span>Add Node<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ol>\n<li>Open the dialog task to add the Message node.<\/li>\n<li>Add message node in the designated place. For steps in adding nodes, <a href=\"\/docs\/bots\/chatbot-overview\/using-the-dialog-builder-tool\/#Adding_Nodes\">refer here<\/a>.<\/li>\n<li>The Message window is displayed with the <strong>Component Properties<\/strong> tab selected by default.<\/li>\n<\/ol>\n<\/div><\/div><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 class=\"wpb_text_column\"><div class=\"wpb_wrapper\"><h2><span class=\"ez-toc-section\" id=\"Configure_Node\"><\/span>Configure Node<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"Component_Properties\"><\/span>Component Properties<span class=\"ez-toc-section-end\"><\/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.<\/li>\n<li>You can enter channel-specific messages for bot responses using the <strong>Manage<\/strong>\u00a0link. For more information, refer to\u00a0<a href=\"\/docs\/bots\/bot-builder-tool\/dialog-task\/prompt-editor\/\">Using the Prompt Editor<\/a>.<\/li>\n<li>To add more bot responses, click\u00a0<strong>Add Bot Response<\/strong> and repeat the above steps.<\/li>\n<\/ol>\n<h3><span class=\"ez-toc-section\" id=\"Generate_Message_as_Report_Link_Optional\"><\/span>Generate Message as Report Link (Optional)<span class=\"ez-toc-section-end\"><\/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=\"https:\/\/s3-us-east-2.amazonaws.com\/kore-wordpress\/developer.kore.ai\/wp-content\/uploads\/sites\/22\/20210707065922\/messageNode_report.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-28365\" src=\"https:\/\/s3-us-east-2.amazonaws.com\/kore-wordpress\/developer.kore.ai\/wp-content\/uploads\/sites\/22\/20210707065922\/messageNode_report.png\" alt=\"\" width=\"1366\" height=\"768\" \/><\/a><br \/>\nThis image corresponds to the new dialog builder, you will find this feature in legacy builder at the same location i.e. Message node -&gt; Component Properties.<\/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=\"\/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=\"\/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=\"\/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=\"\/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=\"\/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=\"Variable_Namespace\"><\/span>Variable Namespace<span class=\"ez-toc-section-end\"><\/span><\/h3>\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=\"\/docs\/bots\/bot-settings\/bot-management\/managing-namespace\/\" target=\"_blank\" rel=\"noopener noreferrer\">Managing Namespace<\/a>.<\/li>\n<\/ul>\n<\/div><\/div><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 class=\"wpb_text_column\"><div class=\"wpb_wrapper\"><h3><span class=\"ez-toc-section\" id=\"Instance_Properties\"><\/span>Instance Properties<span class=\"ez-toc-section-end\"><\/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 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=\"\/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=\"\/docs\/bots\/bot-builder-tool\/dialog-task\/custom-meta-tags\/\">Click here for more<\/a>.<\/li>\n<\/ol>\n<\/div><\/div><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 class=\"wpb_text_column\"><div class=\"wpb_wrapper\"><h3><span class=\"ez-toc-section\" id=\"IVR_Properties\"><\/span>IVR Properties<span class=\"ez-toc-section-end\"><\/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=\"\/docs\/bots\/advanced-topics\/ivr-integration\/ivr-integration\/#ivr-settings-field-reference\">Click here for details<\/a><\/p>\n<\/div><\/div><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 class=\"wpb_text_column\"><div class=\"wpb_wrapper\"><h3><span class=\"ez-toc-section\" id=\"Connections_Properties\"><\/span>Connections Properties<span class=\"ez-toc-section-end\"><\/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<\/div><\/div><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>[vc_raw_html]JTNDZGl2JTIwY2xhc3MlM0QlMjJ3LXBvc3QtZWxtJTIwcG9zdF9uYXZpZ2F0aW9uJTIwbGF5b3V0X3NpbXBsZSUyMGludl9mYWxzZSUyMiUzRSUwQSUwOSUzQ2ElMjBjbGFzcyUzRCUyMnBvc3RfbmF2aWdhdGlvbi1pdGVtJTIwb3JkZXJfZmlyc3QlMjB0b19wcmV2JTIyJTIwaHJlZiUzRCUyMiUyRmRvY3MlMkZib3RzJTJGYm90LWJ1aWxkZXItdG9vbCUyRmRpYWxvZy10YXNrJTJGd29ya2luZy13aXRoLXRoZS1sb2dpYy1ub2RlJTJGJTIyJTNFJTNDJTJGcCUzRSUwQSUzQ2RpdiUyMGNsYXNzJTNEJTIycG9zdF9uYXZpZ2F0aW9uLWl0ZW0tYXJyb3clMjIlM0UlM0MlMkZkaXYlM0UlMEElM0NkaXYlMjBjbGFzcyUzRCUyMnBvc3RfbmF2aWdhdGlvbi1pdGVtLW1ldGElMjIlM0VQcmV2aW91cyUzQyUyRmRpdiUzRSUwQSUzQ2RpdiUyMGNsYXNzJTNEJTIycG9zdF9uYXZpZ2F0aW9uLWl0ZW0tdGl0bGUlMjIlM0UlM0NzcGFuJTNFTG9naWMlMjBOb2RlJTNDJTJGc3BhbiUzRSUzQyUyRmRpdiUzRSUwQSUzQ3AlM0UlM0MlMkZhJTNFJTNDYnIlMjAlMkYlM0UlMEElM0NhJTIwY2xhc3MlM0QlMjJwb3N0X25hdmlnYXRpb24taXRlbSUyMG9yZGVyX3NlY29uZCUyMHRvX25leHQlMjIlMjBocmVmJTNEJTIyJTJGZG9jcyUyRmJvdHMlMkZib3QtYnVpbGRlci10b29sJTJGZGlhbG9nLXRhc2slMkZ3b3JraW5nLXdpdGgtdGhlLWNvbmZpcm1hdGlvbi1ub2RlcyUyRiUyMiUzRSUzQyUyRnAlM0UlMEElM0NkaXYlMjBjbGFzcyUzRCUyMnBvc3RfbmF2aWdhdGlvbi1pdGVtLWFycm93JTIyJTNFJTNDJTJGZGl2JTNFJTBBJTNDZGl2JTIwY2xhc3MlM0QlMjJwb3N0X25hdmlnYXRpb24taXRlbS1tZXRhJTIyJTNFTmV4dCUzQyUyRmRpdiUzRSUwQSUzQ2RpdiUyMGNsYXNzJTNEJTIycG9zdF9uYXZpZ2F0aW9uLWl0ZW0tdGl0bGUlMjIlM0UlM0NzcGFuJTNFQ29uZmlybWF0aW9uJTIwTm9kZXMlM0MlMkZzcGFuJTNFJTNDJTJGZGl2JTNFJTBBJTNDcCUzRSUzQyUyRmElM0UlM0MlMkZkaXYlM0U=[\/vc_raw_html]<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><\/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":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/multisite.korebots.com\/v9-0\/wp-json\/wp\/v2\/posts\/19909"}],"collection":[{"href":"https:\/\/multisite.korebots.com\/v9-0\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/multisite.korebots.com\/v9-0\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/multisite.korebots.com\/v9-0\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/multisite.korebots.com\/v9-0\/wp-json\/wp\/v2\/comments?post=19909"}],"version-history":[{"count":30,"href":"https:\/\/multisite.korebots.com\/v9-0\/wp-json\/wp\/v2\/posts\/19909\/revisions"}],"predecessor-version":[{"id":29412,"href":"https:\/\/multisite.korebots.com\/v9-0\/wp-json\/wp\/v2\/posts\/19909\/revisions\/29412"}],"wp:attachment":[{"href":"https:\/\/multisite.korebots.com\/v9-0\/wp-json\/wp\/v2\/media?parent=19909"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/multisite.korebots.com\/v9-0\/wp-json\/wp\/v2\/categories?post=19909"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/multisite.korebots.com\/v9-0\/wp-json\/wp\/v2\/tags?post=19909"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}