{"id":17974,"date":"2017-02-06T21:27:42","date_gmt":"2017-02-06T21:27:42","guid":{"rendered":"https:\/\/developer.kore.com\/?post_type=docs&#038;p=10072"},"modified":"2021-03-19T08:36:34","modified_gmt":"2021-03-19T08:36:34","slug":"define-a-card-layout-with-actions-report","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v9-0\/docs\/bots\/bot-builder-tool\/action-info-task\/define-a-card-layout-with-actions-report\/","title":{"rendered":"Define a Card Layout with Actions Report"},"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>With some tasks, you may want to add a link to a message sent to a user that contains data too large for a message, for example, a message with a picture, abstract, and a link to a full article or report. This topic describes how to define a card layout report that is also defined with action tasks.<br \/>\nThe card layout with action report type can be displayed to an end-user when the URL for this report type\u00a0is clicked in a\u00a0message. In the following illustration, the message sent to the end-user contains a link to the card layout\u00a0with actions report called <span style=\"color: #3366ff\">View Items<\/span>. The message contains an abbreviated list of search results.<br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/21\/DIYBotBuilderAlertReportTasksCardLayoutWithActionsLink.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-9624\" src=\"\/wp-content\/uploads\/sites\/21\/DIYBotBuilderAlertReportTasksCardLayoutWithActionsLink.png\" alt=\"\" width=\"359\" height=\"528\" \/><\/a><br \/>\nWhen the user clicks the link in the message, a card layout\u00a0with actions report is displayed with a detailed list of search results with a card\u00a0header, optional card\u00a0description, and a header row as shown in the following illustration for the <em>View Items<\/em>\u00a0report as a list of selectable items to add to a shopping cart.<br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/21\/DIYBotBuilderAlertReportTasksCardLayoutWithActionsLinkReport.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-9625\" src=\"\/wp-content\/uploads\/sites\/21\/DIYBotBuilderAlertReportTasksCardLayoutWithActionsLinkReport.png\" alt=\"Report Link\" width=\"612\" height=\"612\" \/><\/a><br \/>\n<strong>To define a card layout\u00a0with actions report<\/strong><br \/>\nTo complete the following procedure, you must have already defined a task, such as an alert task, or information task, that you want to add a card layout\u00a0with actions report\u00a0link to. Complete the steps in the following procedure to define a card layout\u00a0with actions report.<\/p>\n<ol>\n<li>In Bot Builder, select the task for the Bot that you want to add a card layout\u00a0with actions report link to.\n<p class=\"note\"><strong>Note:<\/strong> Only unpublished tasks can be modified.<\/p>\n<\/li>\n<li>Click the <strong>Settings<\/strong> <img loading=\"lazy\" decoding=\"async\" class=\"icon alignnone wp-image-6240 size-full\" src=\"\/wp-content\/uploads\/sites\/21\/DIYSettingsIcon-2.png\" width=\"18\" height=\"18\" \/>\u00a0icon, and then click <strong>Edit<\/strong>.<\/li>\n<li>On the <strong>Bot Response<\/strong>\u00a0tab for the task that you want to add a card layout\u00a0with actions report to, click the <strong>Expand<\/strong>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"icon alignnone wp-image-6276 size-full\" src=\"\/wp-content\/uploads\/sites\/21\/ExpandIcon.png\" width=\"20\" height=\"24\" \/> icon for the <strong>Report Template Definition<\/strong> section.<\/li>\n<li>In the<strong> Link Title<\/strong>\u00a0field, enter the link text to display to the end-user in the task post, for example, <em><span style=\"color: #0000ff\">View Items<\/span><\/em>.<\/li>\n<li>In the<strong> Header<\/strong>\u00a0field, enter the\u00a0title of the report to display when the card layout\u00a0with actions report is displayed to the end-user, for example, <span style=\"color: #0000ff\"><em>Here are your items<\/em><\/span>.<\/li>\n<li>In the<strong> Details<\/strong>\u00a0field, optionally enter any end-user help information displayed directly below the <strong>Header<\/strong> in the report, for example, <em><span style=\"color: #0000ff\">Select your items and scroll to the bottom to add to your cart or a shopping list<\/span><\/em>.<\/li>\n<li>In the <strong>Select Action<\/strong> drop-down list select one action to add to the report, and then click <strong>Add to possible actions list<\/strong>, and then repeat to add more actions as needed. Each added action is displayed in the <strong>Possible Actions<\/strong> field.<\/li>\n<li>In the <strong>Template<\/strong> drop-down list, select <strong>Card Layout With Actions<\/strong>.<\/li>\n<li>Click <strong>Edit Template<\/strong>. The <strong>Card Layout Configuration<\/strong>\u00a0dialog is displayed.<\/li>\n<li>In the <strong>Card Title<\/strong> text area, enter your custom JavaScript to display the title\u00a0data\u00a0for your card, for example, a static title such as <code>print(\"List of Items in Your Cart\");<\/code> or you can use payload keys, for example,\u00a0<code>print(summary);<\/code><\/li>\n<li>Click <strong>Add Item<\/strong>. The <strong>Item Configuration<\/strong> dialog is displayed as shown in the following illustration.<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/21\/DIYBotBuilderAlertReportTasksCardLayoutReport1.png\"><br \/>\n<\/a><a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/21\/DIYInformationTaskReportCardLayoutActionItemConf.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-10074\" src=\"\/wp-content\/uploads\/sites\/21\/DIYInformationTaskReportCardLayoutActionItemConf.png\" alt=\"Card Layout with Actions Report - Item Configuration Dialog\" width=\"594\" height=\"954\" \/><\/a><\/li>\n<li>In the\u00a0<strong>Item\u00a0Name<\/strong> field, enter the first column title, for example, <em><span style=\"color: #0000ff\">Name<\/span><\/em>.<\/li>\n<li>In the \u00a0<strong>Data Type<\/strong>\u00a0field, select one of the following data types for the information displayed in the column:\n<ol>\n<li><strong>String<\/strong><\/li>\n<li><strong>Number<\/strong><\/li>\n<li><strong>Date<\/strong><\/li>\n<\/ol>\n<\/li>\n<li>Enable\u00a0<strong>Is a link<\/strong> if the data in the column is a hyperlink. When enabled:\n<ol>\n<li>In the <strong>Link Label<\/strong> field, enter the JavaScript to display the text for the link, for example, <code>print(Name);<\/code> .<\/li>\n<li>In the <strong>URL Value<\/strong> field, enter the JavaScript to display the data to output when the <strong>Link Label<\/strong> is clicked, for example,\u00a0<code>print(\"https:\/\/login.salesforce.com\/\" + Id);<\/code><\/li>\n<\/ol>\n<\/li>\n<li>If <strong>Is a link<\/strong> is not enabled, then\u00a0enter the JavaScript to display the value for the column in the <strong>Item Value<\/strong> text area, for example,\n<pre class=\"toolbar:1 lang:default decode:true\">var obj={};\r\nobj[\"title\"]=name;\r\nobj[\"value\"] = partNumber;\r\nobj = JSON.stringify(obj);\r\nobj = obj.replace(\/&amp;quot;\/g,'\"');\r\nobj = obj.replace(\/&amp;amp;\/g,'&amp;');\r\nprint(obj);<\/pre>\n<\/li>\n<li>In the <strong>Display it as an image<\/strong> section, select <strong>Yes<\/strong> if the column value is an image.<\/li>\n<li>In the <strong>Display it as HTML<\/strong> section,\u00a0select <strong>Yes<\/strong> if the column value contains HTML content.<\/li>\n<li>In the <strong>Action Payload Key Mapping<\/strong> field,\u00a0you can display a response key as a link by mapping an action response key, for example, <em><span style=\"color: #0000ff\">partNumber<\/span><\/em>, to the <strong>Item Value<\/strong> field displayed\u00a0to the end-user as the item\u00a0<strong>Name<\/strong>\u00a0as shown in the previous illustration.<\/li>\n<li>Click <strong>Done<\/strong>. The <strong>Card Layout\u00a0Configuration<\/strong> dialog is displayed with the new column added as shown in the following illustration.<br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/21\/DIYInformationTaskReportCardLayoutActionCardConf.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-10075\" src=\"\/wp-content\/uploads\/sites\/21\/DIYInformationTaskReportCardLayoutActionCardConf.png\" alt=\"Card Layout with Actions Report - Card Layout Configuration Dialog\" width=\"592\" height=\"559\" \/><\/a><\/li>\n<li>Repeat Steps 11 &#8211; 19 for each additional column in the report, click\u00a0<strong>Save<\/strong> to save the column configurations, and then click <strong>Close<\/strong>.<\/li>\n<li>In the <strong>Report Template Definition<\/strong> section, click <strong>Save<\/strong> to save the\u00a0card layout with actions report.<\/li>\n<\/ol>\n<p>The table is saved <em>Successfully saved response data<\/em> message is displayed at the top of the page.<\/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":"With some tasks, you may want to add a link to a message sent to a user that contains data too large for a message, for example, a message with a picture, abstract, and a link to a full article or report. This topic describes how to define a card layout report that is also...","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[38],"tags":[],"class_list":["post-17974","post","type-post","status-publish","format-standard","hentry","category-action-info-task"],"_links":{"self":[{"href":"https:\/\/developer.kore.ai\/v9-0\/wp-json\/wp\/v2\/posts\/17974","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.kore.ai\/v9-0\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.kore.ai\/v9-0\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v9-0\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v9-0\/wp-json\/wp\/v2\/comments?post=17974"}],"version-history":[{"count":2,"href":"https:\/\/developer.kore.ai\/v9-0\/wp-json\/wp\/v2\/posts\/17974\/revisions"}],"predecessor-version":[{"id":26718,"href":"https:\/\/developer.kore.ai\/v9-0\/wp-json\/wp\/v2\/posts\/17974\/revisions\/26718"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v9-0\/wp-json\/wp\/v2\/media?parent=17974"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v9-0\/wp-json\/wp\/v2\/categories?post=17974"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v9-0\/wp-json\/wp\/v2\/tags?post=17974"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}