{"id":27075,"date":"2021-03-17T06:44:06","date_gmt":"2021-03-17T06:44:06","guid":{"rendered":"https:\/\/developer.kore.ai\/v9-0\/?p=27075"},"modified":"2021-03-17T06:44:06","modified_gmt":"2021-03-17T06:44:06","slug":"alert-task-advanced-settings","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v9-0\/docs\/bots\/bot-builder-tool\/alert\/alert-task-advanced-settings\/","title":{"rendered":"Alert Task \u2013 Advanced Settings"},"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><a href=\"\/v9-0\/v9-0\/docs\/bots\/bot-builder-tool\/alert\/notification-tasks\/#Alert_Settings\">As seen here<\/a>, in the Advanced Settings section, you can define alert task settings for enabling and limiting the initial set of alert messages displayed to the end-user when the task is set up, define alert message reminders, and if required, prevent duplicate messages sent to the user.<\/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<h4>Defined Advanced Settings<\/h4>\n<p>In the <strong>Advanced Settings<\/strong> section, you can define the initial polling results for a task, define an alert reminder, and specify keys the Bots Platform should use to prevent duplicate alert messages, for example, in a <em>Twitter<\/em> or <em>Facebook<\/em> feed.<br \/>\nTo define advanced settings for a\u00a0task, on the <strong>Settings<\/strong>\u00a0tab, click the <strong>Expand<\/strong>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"icon alignnone wp-image-8284 size-full\" src=\"\/wp-content\/uploads\/sites\/21\/Expand-Icon.png\" width=\"20\" height=\"24\" \/> icon in the <strong>Advanced Settings<\/strong>\u00a0section as shown in the following illustration.<br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/21\/DIYAlertTaskSettingsTabAdvancedSettngsSection.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9933\" src=\"\/wp-content\/uploads\/sites\/21\/DIYAlertTaskSettingsTabAdvancedSettngsSection.png\" alt=\"AlertTask - Settings Tab - Advanced Settings Section\" width=\"766\" height=\"564\" \/><\/a><\/p>\n<h5>Initial Polling Setup<\/h5>\n<p>Initial polling is an option you can define to enable display of events to end-users immediately after they set up the task. For example, for a <em>CNN News Bots<\/em>, you can enable initial polling to show the last 10 news posts immediately after the end-user adds the task to their application. If initial polling is not defined, the task polling begins after the specified <strong>Trigger Interval<\/strong> has elapsed.<br \/>\nTo enable and configure initial polling, in the <strong>Perform Initial Poll<\/strong>\u00a0section, select <strong>Yes<\/strong>. In the <strong>No of posts<\/strong> field, enter the number of previous posts that should be posted immediately in the end-user application, as shown in the following illustration.<br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/21\/DIYAlertTaskSettingsTabAdvancedSettingsSectionPoll.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9934\" src=\"\/wp-content\/uploads\/sites\/21\/DIYAlertTaskSettingsTabAdvancedSettingsSectionPoll.png\" alt=\"Initial Polling for a Task\" width=\"663\" height=\"155\" \/><\/a><\/p>\n<h5><span class=\"wysiwyg-font-size-large\">Setting Up Alert Reminders<\/span><\/h5>\n<p>For some tasks, for example, the <em>Google Calendar<\/em> <em>Event Updates<\/em> task, you may want to add a reminder to the task. The reminder sends a reminder message to the end-user after receipt of\u00a0the original task message. For example, the end-user may want to set up a 30-minute and 15-minute reminder before an event with the task message.<br \/>\nTo enable and configure reminders, in the <strong>Enable Alert Reminder<\/strong> section, click <strong>Yes<\/strong>. The reminder configuration section is displayed as shown in the following illustration.<br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/21\/DIYAlertTaskSettingsTabAdvancedSettngsSectionReminder1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9935\" src=\"\/wp-content\/uploads\/sites\/21\/DIYAlertTaskSettingsTabAdvancedSettngsSectionReminder1.png\" alt=\"Task Reminder\" width=\"823\" height=\"779\" \/><\/a><br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/21\/DIYAlertTaskSettingsTabAdvancedSettngsSectionReminder2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-9936 size-full\" src=\"\/wp-content\/uploads\/sites\/21\/DIYAlertTaskSettingsTabAdvancedSettngsSectionReminder2.png\" alt=\"Task Reminder Part 2\" width=\"830\" height=\"629\" \/><\/a><br \/>\nTo configure an alert reminder:<\/p>\n<ol>\n<li>In the <strong>Enable Alert Reminder<\/strong> section, click <strong>Yes<\/strong> to display the alert reminder settings.<\/li>\n<li>In the <strong>Reminder Frequency<\/strong> section, click in the text box to display and select one or more intervals for the frequency of the reminder ranging from <strong>5 mins<\/strong> to <strong>7 days<\/strong>.<\/li>\n<li>In the <strong>Reminder Message<\/strong> text area, enter the message to display to the end-user for the event reminder. For example,<br \/>\n<code>print('Event starts in '+__frequency__);<\/code><br \/>\nTo use system generated keys, click <strong>Select any key<\/strong> and choose a key from the dropdown list.<\/li>\n<li>In the <strong>Identity Event Modification<\/strong> section, enter one or more keys in a comma-separated list used to identify new events. For example,\u00a0<span style=\"color: #0000ff;\">id, LastModifiedDateTime, subject<\/span>.<\/li>\n<li>In the <strong>Event Start Time<\/strong> section, enter the message to display to the end-user for the start date and time of the event using the alert\u00a0task\u00a0payload field that contains the event start time. For example,\n<pre class=\"lang:default decode:true \">  if (due_at) {\r\n       print(due_at);\r\n   } else if (due_on) {\r\n       var dt = new Date(created_at);\r\n       var dtt = new Date(due_on);\r\n       dt.setYear(dtt.getFullYear());\r\n       dt.setMonth(dtt.getMonth());\r\n       dt.setDate(dtt.getDate());\r\n       dt.setHours(00);\r\n       dt.setMinutes(00);\r\n       dt.setSeconds(00)\r\n       print(dt.toISOString());\r\n   }<\/pre>\n<\/li>\n<li>In the <strong>Format to Identify Recurrence<\/strong> section, select the type of recurrence pattern format used\u00a0in the payload as one of <strong>RRule<\/strong> or <strong>Cron.<\/strong>\n<ul>\n<li><strong>RRule<\/strong> &#8211; A JavaScript library for working with recurrence rules for calendar dates. Use this for iCalendar events. For more information, see <a href=\"http:\/\/www.kanzaki.com\/docs\/ical\/rrule.html\">Recurrence Rule<\/a>.<\/li>\n<li><strong>Cron<\/strong> &#8211; Used for scheduling tasks in the future. For more information, see <a href=\"https:\/\/en.wikipedia.org\/wiki\/Cron#CRON_expression\">Cron Expressions<\/a>.<\/li>\n<\/ul>\n<\/li>\n<li>In the <strong>Recurrence Pattern<\/strong> section, define the string displayed to the end-user to show the frequency of a repeating event, such as\u00a0a recurring weekly meeting. For example,\n<pre class=\"toolbar:1 lang:default decode:true \">if (typeof(Recurrence) !== 'undefined' &amp;&amp; Recurrence) {\r\n    var map = new Object();\r\n    map['Daily'] = \"DAILY\";\r\n    map['Weekly'] = \"WEEKLY\";\r\n    map['AbsoluteMonthly'] = \"MONTHLY\";\r\n    map['RelativeMonthly'] = \"MONTHLY\";\r\n    map['AbsoluteYearly'] = \"YEARLY\";\r\n    map['AbsoluteYearly'] = \"YEARLY\";\r\n    map['First'] = 1\r\n    map['Second'] = 2\r\n    map['Third'] = 3\r\n    map['Fourth'] = 4\r\n    map['Last'] = -1\r\n    map['Sunday'] = 'SU'\r\n    map['Monday'] = 'MO'\r\n    map['Tuesday'] = 'TU'\r\n    map['Wednesday'] = 'WE'\r\n    map['Thursday'] = 'TH'\r\n    map['Friday'] = 'FR'\r\n    map['Saturday'] = 'SA'\r\n    var rrule = '';\r\n    if (typeof(Recurrence.Pattern.Type) !== 'undefined') {\r\n        var freq = map[Recurrence.Pattern.Type];\r\n        rrule = rrule + 'FREQ=' + freq + ';';\r\n    }\r\n    if (typeof(Recurrence.Range.StartDate) !== 'undefined') {\r\n        var stDate = new Date(Recurrence.Range.StartDate).toISOString();\r\n        rrule = rrule + 'DTSTART=' + stDate + ';';\r\n    }\r\n    if (typeof(Recurrence.Pattern.Interval) !== 'undefined') {\r\n        var interval = Recurrence.Pattern.Interval\r\n        rrule = rrule + 'INTERVAL=' + interval + ';';\r\n    }\r\n    if (typeof(Recurrence.Range.EndDate) !== 'undefined' &amp;&amp; Recurrence.Range.Type !== 'NoEnd') {\r\n        var edDate = new Date(Recurrence.Range.EndDate).toISOString();\r\n        rrule = rrule + 'UNTIL=' + edDate + ';';\r\n    }\r\n    if (typeof(Recurrence.Pattern.Month) !== 'undefined' &amp;&amp; Recurrence.Pattern.Month !== 0) {\r\n        rrule = rrule + 'BYMONTH=' + Recurrence.Pattern.Month + ';';\r\n    }\r\n    if (typeof(Recurrence.Pattern.DayOfMonth) !== 'undefined' &amp;&amp; Recurrence.Pattern.DayOfMonth !== 0) {\r\n        rrule = rrule + 'BYMONTHDAY=' + Recurrence.Pattern.DayOfMonth + ';';\r\n    }\r\n    if (typeof(Recurrence.Pattern.Index) !== 'undefined') {\r\n        var wno = map[Recurrence.Pattern.Index];\r\n        rrule = rrule + 'BYSETPOS=' + wno + ';';\r\n    }\r\n    if (typeof(Recurrence.Pattern.DaysOfWeek) !== 'undefined') {\r\n        var arr = [];\r\n        for (var i = 0; i &lt; Recurrence.Pattern.DaysOfWeek.length; i++) {\r\n            arr.push(map[Recurrence.Pattern.DaysOfWeek[i]])\r\n        }\r\n        rrule = rrule + 'BYDAY=' + arr.join(',') + ';';\r\n    }\r\n    print(rrule);\r\n}<\/pre>\n<\/li>\n<li>If the <strong>Format to Identify Recurrence<\/strong>\u00a0field is set to <strong>Cron<\/strong>, then define the <strong>Event End\u00a0<\/strong>section to define the string displayed to the end-user to show the date and time of the last recurring event.<\/li>\n<\/ol>\n<p>Click <strong>Save<\/strong> to save the settings.<\/p>\n<h6><span class=\"wysiwyg-font-size-large\">Preventing Duplicate\u00a0Message\u00a0Alerts<\/span><\/h6>\n<p>After you add your filters for the response object, you should determine if you need to apply a strategy to prevent the display of duplicate messages to the end-user. For example, if you set up an RSS task, you may want to prevent duplicate messages\u00a0for the same subject, or for <em>Facebook<\/em>, prevent duplicate\u00a0messages each time a comment is added to a post.<br \/>\nIn Kore.ai, you can choose one of two\u00a0options for\u00a0<strong>Deduplicate Strategy<\/strong>:<\/p>\n<ul>\n<li><strong>None<\/strong> &#8211; This is the default method to prevent duplicate alert\u00a0messages. Each<span class=\"s1\">\u00a0incoming task\u00a0payload is hashed and the latest 500 task\u00a0hash values are persisted. Each new task payload\u00a0is compared against the list to prevent duplicate task alert\u00a0messages. This option works for most tasks.<\/span><\/li>\n<li><strong>ExcludeByCachedIds<\/strong> &#8211; Select to enter one or more response identifier keys in a comma-separated list used to filter Kore.ai task alert messages and prevent duplication based on the cached hash value of the key for up to 500 hash values. If any of the key hash values match the response object, then the alert message is filtered and not displayed. For RSS <strong>Alert\u00a0Types<\/strong>, RSS XML payloads are parsed as JSON. To filter by RSS item, enter <code>$..guid[0]._<\/code> to prevent duplicate messages\u00a0using\u00a0the XML &lt; <em>GUID<\/em>\u00a0&gt; tag parsed to JSON as:\n<pre class=\"toolbar:1 lang:default decode:true \">{\r\n    \"guid\": [\r\n        \"_\": \"some link\"\r\n    ]\r\n}<\/pre>\n<\/li>\n<\/ul>\n<p>To define settings to prevent duplication messages for a\u00a0task, on the <strong>Settings<\/strong>\u00a0tab, click the <strong>Expand<\/strong>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"icon alignnone wp-image-8284 size-full\" src=\"\/wp-content\/uploads\/sites\/21\/Expand-Icon.png\" width=\"20\" height=\"24\" \/> icon in the <strong>Advanced Settings<\/strong>\u00a0section to display the <strong>Deduplicate Strategy<\/strong> section as shown in the following illustration.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9937\" src=\"\/wp-content\/uploads\/sites\/21\/DIYAlertTaskSettingsTabAdvancedSettingsSectionDeDuplicate.png\" alt=\"Deduplicate Strategy Settings\" width=\"878\" height=\"166\" \/><\/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":"As seen here, in the Advanced Settings section, you can define alert task settings for enabling and limiting the initial set of alert messages displayed to the end-user when the task is set up, define alert message reminders, and if required, prevent duplicate messages sent to the user. Defined Advanced Settings In the Advanced Settings...","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[67],"tags":[],"class_list":["post-27075","post","type-post","status-publish","format-standard","hentry","category-alert"],"_links":{"self":[{"href":"https:\/\/developer.kore.ai\/v9-0\/wp-json\/wp\/v2\/posts\/27075","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=27075"}],"version-history":[{"count":1,"href":"https:\/\/developer.kore.ai\/v9-0\/wp-json\/wp\/v2\/posts\/27075\/revisions"}],"predecessor-version":[{"id":27076,"href":"https:\/\/developer.kore.ai\/v9-0\/wp-json\/wp\/v2\/posts\/27075\/revisions\/27076"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v9-0\/wp-json\/wp\/v2\/media?parent=27075"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v9-0\/wp-json\/wp\/v2\/categories?post=27075"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v9-0\/wp-json\/wp\/v2\/tags?post=27075"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}