{"id":17972,"date":"2017-02-06T17:16:25","date_gmt":"2017-02-06T17:16:25","guid":{"rendered":"https:\/\/developer.kore.com\/?post_type=docs&#038;p=10056"},"modified":"2021-03-19T08:39:19","modified_gmt":"2021-03-19T08:39:19","slug":"defining-a-card-layout-report","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v9-1\/docs\/bots\/bot-builder-tool\/dialog-task\/defining-a-card-layout-report\/","title":{"rendered":"Defining a Card Layout 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, an message with a picture, abstract, and a link to a full article or report. This topic describes how to define a card layout\u00a0report.<br \/>\nThe card layout\u00a0report 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\u00a0report called <span style=\"color: #3366ff\">Today&#8217;s Summary<\/span>.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4468 size-full\" src=\"\/wp-content\/uploads\/sites\/22\/DIYBotBuilderAlertReportTasksCardLayoutAlert.png\" alt=\"DIYBotBuilderAlertReportTasksCardLayoutAlert\" width=\"424\" height=\"185\" \/><br \/>\nWhen the user clicks the link in the message, a card layout\u00a0report with a card\u00a0header, optional card\u00a0description, and a header row as shown in the following illustration for the <em>Today&#8217;s Summary<\/em>\u00a0report.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4469 size-full\" src=\"\/wp-content\/uploads\/sites\/22\/DIYBotBuilderAlertReportTasksCardLayoutAlertClicked.png\" alt=\"DIYBotBuilderAlertReportTasksCardLayoutAlertClicked\" width=\"694\" height=\"196\" \/><br \/>\n<strong>To define a card layout 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\u00a0report link to. Complete the steps in the following procedure to define a card layout\u00a0report.<\/p>\n<ol>\n<li>In Bot Builder, select the task for the Bot that you want to add a card layout report link to.<br \/>\n<strong>Note:<\/strong> Only unpublished tasks can be modified.<\/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\/22\/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\u00a0report 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\/22\/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\">Today&#8217;s Summary<\/span><\/em>.<\/li>\n<li>In the<strong> Header<\/strong>\u00a0field, enter the\u00a0title of the report to display when the card layout\u00a0report is displayed to the end-user.<\/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\">These are the details for Today&#8217;s Summary Card Layout Report<\/span><\/em>.<\/li>\n<li>In the <strong>Template<\/strong> drop-down list, select <strong>Card layout<\/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(\"Today's Summary Report\");<\/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\/22\/DIYBotBuilderAlertReportTasksCardLayoutReport1.png\"><br \/>\n<\/a><a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/22\/DIYInformationTaskReportTableCardLayoutItem.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-10062\" src=\"\/wp-content\/uploads\/sites\/22\/DIYInformationTaskReportTableCardLayoutItem.png\" alt=\"Card Layout Report - Item Configuration Dialog\" width=\"600\" height=\"810\" \/><\/a><a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/22\/DIYBotBuilderAlertReportTasksCardLayoutReport1.png\"><br \/>\n<\/a><\/li>\n<li>In the\u00a0<strong>Item\u00a0Name<\/strong> field, enter the first column title, for example, <em><span style=\"color: #0000ff\">Task<\/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 the<strong> Item Value<\/strong> field, for example,\n<pre class=\"toolbar:1 lang:default decode:true\">if(typeof(start.dateTime) !== 'undefined'){\r\n    if((new Date(end.dateTime).getTime()-new Date(start.dateTime).getTime())\/(60*60*1000) &gt;24){\r\n\t\tprint('\\\\dt(' + new Date(start.dateTime).toISOString() + ',\\'ddd., MMM. dd, yyyy hh:mm a\\')');\r\n        print(\" - \")\r\n        print('\\\\dt(' + new Date(end.dateTime).toISOString() + ',\\'ddd., MMM. dd, yyyy hh:mm a\\')');\r\n\t} else {\r\n       print('\\\\dt(' + new Date(start.dateTime).toISOString() + ',\\'ddd., MMM. dd, yyyy hh:mm a\\')');\r\n       print(\" - \")\r\n       print('\\\\dt(' + new Date(end.dateTime).toISOString() + ',\\'hh:mm a\\')');\r\n\t}\r\n} else {\r\n  print('\\\\dt('+new Date(start.date).toISOString()+',\\'MMM DD\\')');\r\n}<\/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>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\/22\/DIYInformationTaskReportTableCardLayout.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-10058\" src=\"\/wp-content\/uploads\/sites\/22\/DIYInformationTaskReportTableCardLayout.png\" alt=\"Card Layout Configuration Dialog\" width=\"599\" height=\"559\" \/><\/a><\/li>\n<li>Repeat Steps 10 &#8211; 17\u00a0for 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 card layout\u00a0report.<\/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_medium 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, an message with a picture, abstract, and a link to a full article or report. This topic describes how to define a card layout\u00a0report. The card layout\u00a0report type...","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-17972","post","type-post","status-publish","format-standard","hentry","category-dialog-task"],"_links":{"self":[{"href":"https:\/\/developer.kore.ai\/v9-1\/wp-json\/wp\/v2\/posts\/17972","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.kore.ai\/v9-1\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.kore.ai\/v9-1\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v9-1\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v9-1\/wp-json\/wp\/v2\/comments?post=17972"}],"version-history":[{"count":1,"href":"https:\/\/developer.kore.ai\/v9-1\/wp-json\/wp\/v2\/posts\/17972\/revisions"}],"predecessor-version":[{"id":20719,"href":"https:\/\/developer.kore.ai\/v9-1\/wp-json\/wp\/v2\/posts\/17972\/revisions\/20719"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v9-1\/wp-json\/wp\/v2\/media?parent=17972"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v9-1\/wp-json\/wp\/v2\/categories?post=17972"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v9-1\/wp-json\/wp\/v2\/tags?post=17972"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}