1. Home
  2. Kore.ai Conversational Platform
  3. Bot Builder Tool
  4. Defining Bot Tasks
  5. Alert Tasks
  6. Defining Settings for an Alert Task

Defining Settings for an Alert Task

After you define the General tab settings for your Bot  task, configure the API request chain, define the Bot response message, then you are ready to define the settings for the task, such as filters, when the alert task runs, and other advanced options. This section describes how to define the parameters on the Settings tab for an alert task.

Note: This section does not apply to webhook alert tasks.

The following illustration shows an example of the Settings tab for an alert task.

Alert Task Settings Tab

What Do I Need to Do?

For an alert task, other than a webhook alert task, you will need to define:

  • Filters – You can define filters for end-users to limits the results of an alert task to the results an end-user needs. For example, you can define a filter for name, or account, or business. When the alert is set up by the end-user, and the filter applied, only alert messages that meet the filter specifications are displayed to the end-user. For more information, see Defining Filters for a Task.
  • Schedule – Alert tasks only reach out to a web service for data when the Bot makes a request. For each task, you need to define when, and how often the web service is queried for data for an alert message. You can define the scheduling options presented to the end-user when the task is set up, as well as the default schedule for the task. For more information, see Configuring the Schedule for a Task.
  • Advanced Settings – 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. For more information, see Define Advanced Settings.

Defining Filters for a Task

To get started with defining filters for a task, on the Settings tab, click the Expand  icon in the Filters section, and then click Add as shown in the following illustration.

Alert Task - Settings Tab - Filters Section

When you click Add, the Alert Task Filter dialog is displayed as shown in the following illustration.

Alert Task Filter Dialog

The Filter defined in the previous illustration is displayed to the end-user as a filter labeled Owner, with the Field Type set to Dynamic Dropdown to enable the end-user to select a name from a dynamically populated list of owners defined in the response payload.

Define the fields described in the following table to create a new filter for a task.

PARAMETER NAMEDESCRIPTION
NameSpecify the name of the Filter displayed to the end-user in Filters section when configuring the task, for example, Notify me only when the below user tweets.
Field NameEnter the name of field to filter the task on, or click Select Field to display a drop-down list of field names parsed from the Response Sample defined on the task API Request tab.
Field Type

Select the type of input field to collect the user input.

  • Textbox – Displays a text box to the user. In the Placeholder field, enter a description for the field, for example, Type in the name you want to embroider.
  • Textarea – Displays a text area box to the user, typically allowing to enter several sentences. In the Placeholder field, enter a description for the text area.
  • Static Dropdown – Displays a drop-down list of choices to the user. Click Add Option to begin adding the list of items, with the following parameters:
    • Option Name – The name of the option displayed to the user.
    • Option Value – The value associated with the option.
    • Default Value – Select the default value for the list when more than one option is defined.
    • Searchable – Select to enable type-ahead suggestions from the list matching the user’s typing.

    Click Save. To add additional items, click Add Option again. Edit or remove options in the Actions column for options.

  • Dynamic Dropdown – Displays a drop-down list dynamically populated at runtime based on the response from a URL for your Bot, for example, a list of projects for a JIRA task notification. Define the following properties for a dynamically populated drop-down.
    • Endpoint URL – The Bot endpoint URL, for example, https://app.asana.com/api/1.0/workspaces.
    • Endpoint Content Type – One of these content types expected from the specified endpoint URL: JSON, RSS, XML, Encoded JSON, CSV, or Text.
    • Endpoint Method – Select one of the following:
      • GET – Specifies an HTTP Request GET method for the task field.
      • POST – Specifies an HTTP Request POST method for the task field.
    • Response Path – The path in the response that contains the desired drop-down list values, for example, data.
    • Label Key – The key for the label of the drop-down option, for example, name.
    • Optional Value Key – The key for the value of the drop-down option, for example, id.
    • Add Payload Field – Click to add one or more fields from the response payload as options for the type-ahead field. For each type ahead field option, enter the Payload field key and the Payload field value, and then click Save. Edit or delete payload fields in the Actions column.
  • Check Box – Displays a list of choices that the user can select from – one or more. Click Add Option to begin adding the list of items to display, with the following parameters:
    • Option Name – The name of the option displayed to the end-user.
    • Option Value – The corresponding value for the option name.
  • Type Ahead – Displays a dynamically populated drop-down list of choices to the user at runtime when the user enters three or more characters that match the search results based on the response from the URL defined for the task. For example, a list of projects for a JIRA task notification message. Define the following properties for a dynamically populated drop-down.
    • Endpoint URL – The Bot endpoint URL, for example, https://app.asana.com/api/1.0/workspaces.
    • Endpoint Content Type – The content type expected from the specified endpoint URL. One of: JSON, RSS, XML, URL Encoded JSON, CCV, Text, Twitter Encoded JSON, Multipart/Form-data, or Multipart/Related.
    • Endpoint Method – Select one of the following:
      • GET – Specifies an HTTP Request GET method for the task field.
      • POST – Specifies an HTTP Request POST method for the task field.
    • Response Path – The path in the response that contains the desired drop-down list values, for example, data.
    • Label Key – The key for the label of the drop-down option, for example, name.
    • Option Value Key – The key for the value of the drop-down option, for example, id.
    • Add Payload Field – Click to add one or more fields from the response payload as options for the type-ahead field. For each type ahead field option, enter the Payload field key and the Payload field value, and then click Save. Edit or delete payload fields in the Actions column.
    • Editable – Enables the end-user to enter text free-from in the field as an option when type-ahead search results do not match.
  • Dynamic Check Box – Displays a list of choices that the end-user can select one or more from, which are dynamically populated at runtime based on the response from a URL for your Bot, for example, a list of projects for a JIRA task notification. Define the following properties for a dynamically populated list of choices as checkboxes.
    • Endpoint URL – The Bot endpoint URL, for example, https://app.asana.com/api/1.0/workspaces.
    • Endpoint Content Type – The content type expected from the specified endpoint URL. One of: JSON, RSS, XML, Encoded JSON, CSV, or Text.
    • Endpoint Method – Select one of the following:
      • GET – Specifies an HTTP Request GET method for the task field.
      • POST – Specifies an HTTP Request POST method for the task field.
    • Response Path – The path in the response that contains the desired drop-down list values, for example, data.
    • Label Key – The key for the label of the drop-down option, for example, name.
    • Box Value Key – The key for the value of the drop-down option, for example, id.
Data TypeThe data type for the content received from the endpoint URL. One of:

  • Text - The user input for this filter is expected as text.

  • Number - The user input for this filter is expected as an integer.

  • Date - The user input for this filter is a date.

  • List - The user input for this filter is a comma separated list.

OperatorsSelect one or more filter operations that the end-user can select to apply to the filter. Depending on the Data Type selected, one or more of the following options are available to select to display to the end-user in the filter.

  • Contains - The response object filtered text contains all of the specified values.

  • Doesn't Contain - The response object filtered text does not contain all of the specified values.

  • Exact Match - The response object filtered text only contains the specified values.

  • Not an exact match - The response filtered text object does not contain the specified value.

  • Included - The response object filtered text contains any of the specified values.

  • Not Included - The response object filtered text does not contain any of the specified values.

  • Starts with - The response object filtered text begins with the specified value.

  • Doesn't start with - The response object filtered text does not begin with the specified value.

  • Ends with - The response object filtered text ends with the specified value.

  • Doesn't end with - The response object filtered text does not end with the specified value.

  • Equal to - The response object filtered numbers or dates are equal to the specified value.

  • Greater than - The response object filtered numbers or dates are greater than the specified value.

  • Less than - The response object filtered numbers or dates are less than the specified value.

  • Exists - The response object filtered list contains the specified value.

  • Doesn't exist - The response object filter list does not contain the specified value.

For multiple filters, you can order the filters in an order the end-user expects, shown in numerical order in the following illustration.

Alert Task - Settings Tab - Filters Section

Use the Move Up  icon and the Move Down  icon in the Actions column in the Filters section to reorder the filters if needed.

Click the Edit  icon to modify the settings for an existing filter.

Click the Delete  icon to delete an existing filter.

Warning: This operation is permanent and cannot be undone.

Configuring the Schedule for a Task

You need to configure the default settings for how often the task runs to request data from your web service. This topic describes how to configure the recurrence for a task.

To get started with defining the schedule to run a task, on the Settings tab, click the Expand  icon in the Schedule section as shown in the following illustration.

Alert Task - Settings Tab - Schedule Section

To configure the schedule for your task, you must define the Trigger Interval Options, and then the Default Trigger Interval. The Default Trigger Interval is the elapsed time between last task request and the next automated task request.

To set the options displayed to the end-user, in the Trigger Interval Options section:

  • In the first field, select one or more of Daily, Weekday, Weekend, or Select All, and then click OK.
  • In the second field, select one or more of Daily, Weekday, Weekend, or Select All, and then click OK.
  • In the third field, select one or more of the available 30-minute intervals, or Select All, and then click OK.

In the following illustration, the end-user and Default Trigger Interval settings can be set to Daily, Weekend, or Weekday At < any 30-minute interval >.

Alert Task - Settings Tab - Schedule Section - Trigger Interval

Defined Advanced Settings

In the Advanced Settings 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 Twitter or Facebook feed.

To define advanced settings for a task, on the Settings tab, click the Expand  icon in the Advanced Settings section as shown in the following illustration.

AlertTask - Settings Tab - Advanced Settings Section

Initial Polling Setup

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 CNN News Bots, 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 Trigger Interval has elapsed.

To enable and configure initial polling, in the Perform Initial Poll section, select Yes. In the No of posts field, enter the number of previous posts that should be posted immediately in the end-user application, as shown in the following illustration.

Initial Polling for a Task

Setting Up Alert Reminders

For some tasks, for example, Google Calendar Event Updates task, you may want to add a reminder to the task. The reminder sends a reminder message to the end-user after receipt of the 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.

To enable and configure reminders, in the Enable Alert Reminder section, click Yes. The reminder configuration section is displayed as shown in the following illustration.

Task Reminder

Task Reminder Part 2

To configure an alert reminder

  1. In the Enable Alert Reminder section, click Yes to display the alert reminder settings.
  2. In the Reminder Frequency section, click in the text box to display and select one or more intervals for the frequency of the reminder ranging from 5 mins to 7 days.
  3. In the Reminder Message text area, enter the message to display to the end-user for the event reminder. For example,
    print('Event starts in '+__frequency__);
    To use system generated keys, click Select any key and choose a key from the dropdown list.
  4. In the Identity Event Modification section, enter one or more keys in a comma-separated list used to identify new events. For example, id, LastModifiedDateTime, subject.
  5. In the Event Start Time section, enter the message to display to the end-user for the start date and time of the event using the alert task payload field that contains the event start time. For example,
      if (due_at) {
           print(due_at);
       } else if (due_on) {
           var dt = new Date(created_at);
           var dtt = new Date(due_on);
           dt.setYear(dtt.getFullYear());
           dt.setMonth(dtt.getMonth());
           dt.setDate(dtt.getDate());
           dt.setHours(00);
           dt.setMinutes(00);
           dt.setSeconds(00)
           print(dt.toISOString());
       }
    
    
  6. In the Format to Identify Recurrence section, select the type of recurrence pattern format used in the payload as one of RRule or Cron.
    • RRule – A JavaScript library for working with recurrence rules for calendar dates. Use this for iCalendar events. For more information, see Recurrence Rule.
    • Cron – Used for scheduling tasks in the future. For more information, see Cron Expressions.
  7. In the Recurrence Pattern section, define the string displayed to the end-user to show the frequency of a repeating event, such as a recurring weekly meeting. For example,
    if (typeof(Recurrence) !== 'undefined' && Recurrence) {
        var map = new Object();
        map['Daily'] = "DAILY";
        map['Weekly'] = "WEEKLY";
        map['AbsoluteMonthly'] = "MONTHLY";
        map['RelativeMonthly'] = "MONTHLY";
        map['AbsoluteYearly'] = "YEARLY";
        map['AbsoluteYearly'] = "YEARLY";
    
        map['First'] = 1
        map['Second'] = 2
        map['Third'] = 3
        map['Fourth'] = 4
        map['Last'] = -1
    
        map['Sunday'] = 'SU'
        map['Monday'] = 'MO'
        map['Tuesday'] = 'TU'
        map['Wednesday'] = 'WE'
        map['Thursday'] = 'TH'
        map['Friday'] = 'FR'
        map['Saturday'] = 'SA'
    
    
        var rrule = '';
        if (typeof(Recurrence.Pattern.Type) !== 'undefined') {
            var freq = map[Recurrence.Pattern.Type];
            rrule = rrule + 'FREQ=' + freq + ';';
        }
        if (typeof(Recurrence.Range.StartDate) !== 'undefined') {
            var stDate = new Date(Recurrence.Range.StartDate).toISOString();
            rrule = rrule + 'DTSTART=' + stDate + ';';
        }
        if (typeof(Recurrence.Pattern.Interval) !== 'undefined') {
            var interval = Recurrence.Pattern.Interval
            rrule = rrule + 'INTERVAL=' + interval + ';';
        }
        if (typeof(Recurrence.Range.EndDate) !== 'undefined' && Recurrence.Range.Type !== 'NoEnd') {
            var edDate = new Date(Recurrence.Range.EndDate).toISOString();
            rrule = rrule + 'UNTIL=' + edDate + ';';
        }
    
        if (typeof(Recurrence.Pattern.Month) !== 'undefined' && Recurrence.Pattern.Month !== 0) {
            rrule = rrule + 'BYMONTH=' + Recurrence.Pattern.Month + ';';
    
        }
        if (typeof(Recurrence.Pattern.DayOfMonth) !== 'undefined' && Recurrence.Pattern.DayOfMonth !== 0) {
            rrule = rrule + 'BYMONTHDAY=' + Recurrence.Pattern.DayOfMonth + ';';
        }
    
        if (typeof(Recurrence.Pattern.Index) !== 'undefined') {
            var wno = map[Recurrence.Pattern.Index];
            rrule = rrule + 'BYSETPOS=' + wno + ';';
        }
    
        if (typeof(Recurrence.Pattern.DaysOfWeek) !== 'undefined') {
            var arr = [];
            for (var i = 0; i < Recurrence.Pattern.DaysOfWeek.length; i++) {
                arr.push(map[Recurrence.Pattern.DaysOfWeek[i]])
            }
            rrule = rrule + 'BYDAY=' + arr.join(',') + ';';
    
        }
        print(rrule);
    }
  8. If the Format to Identify Recurrence field is set to Cron, then define the Event End section to define the string displayed to the end-user to show the date and time of the last recurring event.

Click Save to save the settings.

Preventing Duplicate Message Alerts

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 for the same subject, or for Facebook, prevent duplicate messages each time a comment is added to a post.

In Kore.ai, you can choose one of two options for Deduplicate Strategy:

  • None – This is the default method to prevent duplicate alert messages. Each incoming task payload is hashed and the latest 500 task hash values are persisted. Each new task payload is compared against the list to prevent duplicate task alert messages. This option works for most tasks.
  • ExcludeByCachedIds – 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 Alert Types, RSS XML payloads are parsed as JSON. To filter by RSS item, enter $..guid[0]._ to prevent duplicate messages using the XML < GUID > tag parsed to JSON as:
    {
    
        "guid": [
            "_": "some link"
        ]
    }

To define settings to prevent duplication messages for a task, on the Settings tab, click the Expand  icon in the Advanced Settings section to display the Deduplicate Strategy section as shown in the following illustration.

Deduplicate Strategy Settings

Next Steps

With the task configured, you may want to create or map related tasks that a user can take as an action response to a message alert, called a Flow in Kore.ai. For example, if a user gets an alert message from Zendesk that a new ticket was created, examples of a related task could be to add a comment to the ticket or assign the ticket to an agent. For more information, see Creating Flows.

Was this article helpful to you? Yes No