{"id":19909,"date":"2019-05-02T11:33:46","date_gmt":"2019-05-02T11:33:46","guid":{"rendered":"https:\/\/developer.kore.ai\/v7-2\/?p=19909"},"modified":"2021-03-30T07:01:44","modified_gmt":"2021-03-30T06:01:44","slug":"working-with-the-message-nodes","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v7-2\/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 <strong>Message node<\/strong> can be 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 \/>\nBot responses can be formatted as follows:<\/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>. 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 or<\/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>Shows 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>: 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<p><strong>Setting up a Message Node<\/strong><\/p>\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=\"Step_1_Adding_a_Message_Node_to_the_Dialog_Task\">Step 1: Adding a Message Node to the Dialog Task<\/span><\/h3>\n<ol>\n<li>Open the <strong>dialog task<\/strong> in which you want to add the Message node.<\/li>\n<li>Hover over a node next to which you want to add the node, and click the <strong>plus icon<\/strong>.<\/li>\n<li>Select <b>Message &gt; New message node<\/b>. You can select an existing Message Node from the list.<\/li>\n<li>The Component Properties panel for the Message opens.<br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/13\/Navigation-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-13920\" src=\"\/wp-content\/uploads\/sites\/13\/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=\"Step_2a_Configuring_the_Bot_Response\">Step 2a: Configuring 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 <span style=\"text-decoration: underline;\">all other dialog tasks<\/span> that use this node.<\/div>\n<ol>\n<li class=\"aler alert-info\">After you enter a <strong>Name<\/strong> and <strong>Display Name<\/strong> for the Message node<\/li>\n<li class=\"aler alert-info\">You can use the <strong>Bot Responses<\/strong> section to 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 press enter. The message will be saved in the plain text format.<\/li>\n<li class=\"aler alert-info\">Click <b>Manage Responses<\/b>. The Bot Responses window opens. You have further options:\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<\/ul>\n<p>In the <b>Channel <\/b>drop-down list,<b> All Channels<\/b> is the default setting. To create a channel-specific message, select the channel from the list.<br \/>\nIn the Message Editor, the <b>Plain Text <\/b>tab is the default selection. If you want to compose 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. Example: <code>print('Hello'+ context.session.UserContext.firstName+ '. How can I help you')<\/code><br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/13\/prompt-message.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-13921\" src=\"\/wp-content\/uploads\/sites\/13\/prompt-message.png\" alt=\"\" width=\"1013\" height=\"408\" \/><\/a><\/li>\n<li>Compose the message and click <b>Save<\/b>.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>To add any more bot responses, repeat from step 2b.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Step_2b_Generating_Message_as_Report_Link_Optional\">Step 2b: Generating 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 can be 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 these steps:<\/p>\n<ol>\n<li>At the bottom of the Component Properties panel, click the\u00a0<b>Generate Report <\/b>Link.<br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/13\/Report-URL.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-13923\" src=\"\/wp-content\/uploads\/sites\/13\/Report-URL.png\" alt=\"\" width=\"468\" height=\"117\" \/><\/a><\/li>\n<li>In the Generate Report Dialog, 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 can be set to <b>Is Sortable<\/b>, <b>Display as an image<\/b>, and <b>Display it as a link<\/b>. For more information, see <a href=\"\/v7-2\/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 the one or more columns fixed. Each mapping for the <b>Fixed Column Table<\/b> template can be 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, see <a href=\"\/v7-2\/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 can be set to <b>Is Sortable<\/b>, <b>Display as an image<\/b>, and <b>Display it as a link<\/b>. For more information, see <a href=\"\/v7-2\/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 can be set to <b>Is Sortable<\/b>, <b>Display as an image<\/b>, and <b>Display it as a link<\/b>. For more information, see <a href=\"\/v7-2\/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, see <a href=\"\/v7-2\/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<\/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=\"Step_3_Configuring_the_Instance_Properties\">Step 3: Configuring the Instance Properties<\/span><\/h3>\n<ol>\n<li><strong>Hold &amp; Resume: <\/strong>Instance Property for a Message Node can be used to configure the Hold &amp; Resume behavior for this node.<br \/>\n<b>Note:<\/b> The settings in the Instance Properties panel are specific to the current Task and <span style=\"text-decoration: underline;\">do not reflect in the other dialog tasks<\/span> that use this entity node.<\/p>\n<ul>\n<li><strong> Use the task level \u2018Hold &amp; Resume\u2019 setting<\/strong>: The bot refers to the Hold &amp; Resume settings set at the dialog task level.<\/li>\n<li><b>Customize for this node option:<\/b> You can customize the Hold &amp; Resume settings for this node by selecting this option and configuring the same. \u00a0Read the <a href=\"\/v7-2\/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><strong>Custom Tags\u00a0<\/strong>defines tags to build custom profiles of your bot conversations. <a href=\"\/v7-2\/docs\/bots\/bot-builder-tool\/dialog-task\/custom-meta-tags\/\">See 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=\"Step_4_Configuring_the_Connections_Properties\">Step 4: Configuring the Connections Properties<\/span><\/h3>\n<p>From the node\u2019s Connections panel you can determine which 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>You can select from the available nodes under the\u00a0<strong>Default<\/strong> connections.<\/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<ol>\n<li><b>Entity<\/b>: Compare an Entity node in the dialog with a specific value using one of these operators: <b>Exists<\/b>, <b>equals to<\/b>, <b>greater than equals to<\/b>, <b>less than equals to<\/b>, <b>not equal to<\/b>, <b>greater than<\/b>, and <b>less than<\/b>. Select the entity, operator using the respective drop-down lists, and type the number in the <b>Value <\/b>box. 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: <b>Exists<\/b>, <b>equals to<\/b>, <b>greater than equals to<\/b>, <b>less than equals to<\/b>, <b>not equal to<\/b>, <b>greater than<\/b>, and <b>less than. <\/b>Example<b>: <\/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 should match the next user utterance.<\/li>\n<\/ol>\n<\/li>\n<li>In the <b>Then go to<\/b> the 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 If conditions, click <strong>Add Else If<\/strong> below the last If 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=\"Step_5_Configuring_the_IVR_Properties\">Step 5: Configuring the IVR Properties<\/span><\/h3>\n<p>You can use this tab for defining at the Node level the input mode, grammar, prompts and call behavior parameters for this node to be used in IVR Channel. <a href=\"\/v7-2\/docs\/bots\/advanced-topics\/ivr-integration\/ivr-integration\/#ivr-settings-field-reference\">Refer 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><\/div><\/div><\/div><\/div><\/div><\/section>\n","protected":false},"excerpt":{"rendered":"The Message node can be 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. Bot responses can be formatted as follows: Plain text: Type a message in plain text. You can use stored context values with...","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\/v7-2\/wp-json\/wp\/v2\/posts\/19909","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.kore.ai\/v7-2\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.kore.ai\/v7-2\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v7-2\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v7-2\/wp-json\/wp\/v2\/comments?post=19909"}],"version-history":[{"count":6,"href":"https:\/\/developer.kore.ai\/v7-2\/wp-json\/wp\/v2\/posts\/19909\/revisions"}],"predecessor-version":[{"id":22296,"href":"https:\/\/developer.kore.ai\/v7-2\/wp-json\/wp\/v2\/posts\/19909\/revisions\/22296"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v7-2\/wp-json\/wp\/v2\/media?parent=19909"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v7-2\/wp-json\/wp\/v2\/categories?post=19909"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v7-2\/wp-json\/wp\/v2\/tags?post=19909"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}