{"id":27069,"date":"2021-03-17T06:41:41","date_gmt":"2021-03-17T06:41:41","guid":{"rendered":"https:\/\/developer.kore.ai\/v9-0\/?p=27069"},"modified":"2021-03-17T06:41:41","modified_gmt":"2021-03-17T06:41:41","slug":"alert-task-defining-filters","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v9-0\/docs\/bots\/bot-builder-tool\/alert\/alert-task-defining-filters\/","title":{"rendered":"Alert Task \u2013 Defining Filters"},"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\" target=\"_blank\" rel=\"noopener noreferrer\">As we have seen here<\/a>, 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 the 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.<\/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<h2><span class=\"ez-toc-section\" id=\"Defining_Filters\">Defining Filters<\/span><\/h2>\n<p>To get started with defining filters for a\u00a0task, on the <strong>Settings<\/strong>\u00a0tab, click the <strong>Expand<\/strong> icon in the <strong>Filters<\/strong> section, and then click <strong>Add<\/strong> as shown in the following illustration.<br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/21\/DIYAlertTaskSettingsTabFiltersSection.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9925\" src=\"\/wp-content\/uploads\/sites\/21\/DIYAlertTaskSettingsTabFiltersSection.png\" alt=\"Alert Task - Settings Tab - Filters Section\" width=\"783\" height=\"303\" \/><\/a><br \/>\nWhen you\u00a0click <strong>Add<\/strong>, the <strong>Alert\u00a0Task Filter<\/strong> dialog is displayed as shown in the following illustration.<br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/21\/DIYAlertTaskResponseAlertTaskFilterDialog.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8819\" src=\"\/wp-content\/uploads\/sites\/21\/DIYAlertTaskResponseAlertTaskFilterDialog.png\" alt=\"Alert Task Filter Dialog\" width=\"447\" height=\"862\" \/><\/a><br \/>\nThe <strong>Filter<\/strong> defined in the previous illustration is displayed to the end-user as a filter labeled <em>Owner<\/em>, with the <strong>Field Type<\/strong> set to\u00a0<strong>Dynamic Dropdown<\/strong>\u00a0to enable the end-user to select a name from a dynamically populated list of owners defined in the response payload.<br \/>\nDefine the fields described in the following table to create a new filter for a task.<\/p>\n<table>\n<tbody>\n<tr>\n<td style=\"text-align: center;\"><strong>PARAMETER NAME<\/strong><\/td>\n<td style=\"text-align: center;\"><strong>DESCRIPTION<\/strong><\/td>\n<\/tr>\n<tr>\n<td>Name<\/td>\n<td>Specify the name of the <strong>Filter<\/strong> displayed to the end-user in the\u00a0<strong>Filters<\/strong> section when configuring the task, for example, Notify me only when the below user tweets.<\/td>\n<\/tr>\n<tr>\n<td>Field Name<\/td>\n<td>Enter the name of the field to filter the task on, or click <strong>Select Field<\/strong> to display a drop-down list of field names parsed from the <strong>Response Sample<\/strong> defined on the task\u00a0<b>API Request<\/b> tab.<\/td>\n<\/tr>\n<tr>\n<td>Field Type<\/td>\n<td>Select the type of input field to collect the user input.<\/p>\n<ul>\n<li><strong>Textbox<\/strong> &#8211; Displays a text box to the user. In the <strong>Placeholder<\/strong> field, enter a description for the field, for example, <span style=\"color: #0000ff;\">Type\u00a0in the name you want to embroider.<\/span><\/li>\n<li><strong>Textarea<\/strong> &#8211; Displays a text area box to the user, typically allowing to enter several sentences. In the <strong>Placeholder<\/strong> field, enter a description for the text area.<\/li>\n<li><strong>Static Dropdown<\/strong> &#8211; Displays a drop-down list of choices to the user. Click <strong>Add Option<\/strong> to begin adding the list of items, with the following parameters:\n<ul>\n<li><strong>Option Name <\/strong>&#8211; The name of the option displayed to the user.<\/li>\n<li><strong>Option Value<\/strong> &#8211; The value associated with the option.<\/li>\n<li><strong>Default Value<\/strong> &#8211; Select the default value for the list when more than one option is defined.<\/li>\n<li><strong>Searchable<\/strong> &#8211; Select to enable type-ahead suggestions from the list matching the user&#8217;s typing.<\/li>\n<\/ul>\n<p>Click <strong>Save<\/strong>. To add additional items, click <strong>Add Option<\/strong> again. Edit or remove options in the <b>Actions<\/b> column for options.<\/li>\n<li><strong>Dynamic Dropdown<\/strong> &#8211; 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 <em>JIRA<\/em>\u00a0task notification. Define the following properties for a dynamically populated drop-down.\n<ul>\n<li><strong>Endpoint URL<\/strong> &#8211; The Bot\u00a0endpoint URL, for example,\u00a0<span style=\"color: #0000ff;\">https:\/\/app.asana.com\/api\/1.0\/workspaces<\/span>.<\/li>\n<li><strong>Endpoint Content Type<\/strong> &#8211; One of these content types expected from the specified endpoint URL: JSON, RSS, XML, Encoded JSON, CSV, or Text.<\/li>\n<li><strong>Endpoint Method<\/strong> &#8211; Select one of the following:\n<ul>\n<li><strong>GET<\/strong> &#8211; Specifies an HTTP Request GET method for the task\u00a0field.<\/li>\n<li><strong>POST<\/strong> &#8211; Specifies an HTTP Request POST method for the task\u00a0field.<\/li>\n<\/ul>\n<\/li>\n<li><strong>Response Path<\/strong> &#8211; The path in the response that contains the desired drop-down list values, for example, <span style=\"color: #0000ff;\">data<\/span>.<\/li>\n<li><strong>Label Key<\/strong> &#8211; The key for the label of the drop-down option, for example, <span style=\"color: #0000ff;\">name<\/span>.<\/li>\n<li><strong>Optional Value Key<\/strong> &#8211; The key for the value of the drop-down option, for example, <span style=\"color: #0000ff;\">id<\/span>.<\/li>\n<li><strong>Add Payload Field<\/strong> &#8211; 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 <strong>Payload field key<\/strong> and the <strong>Payload field value<\/strong>, and then click <strong>Save<\/strong>. Edit or delete payload fields in the <strong>Actions<\/strong> column.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li><strong>Check Box<\/strong> &#8211; Displays a list of choices that the user can select from &#8211; one or more.\u00a0Click <strong>Add Option<\/strong> to begin adding the list of items to display, with the following parameters:\n<ul>\n<li><strong>Option Name <\/strong>&#8211; The name of the option displayed to the end-user.<\/li>\n<li><strong>Option Value<\/strong> &#8211; The corresponding value for the option name.<\/li>\n<\/ul>\n<\/li>\n<li><strong>Type Ahead<\/strong>\u00a0&#8211; 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\u00a0URL defined for the task. For example, a list of projects for a <em>JIRA<\/em>\u00a0task notification message. Define the following properties for a dynamically populated drop-down.\n<ul>\n<li><strong>Endpoint URL<\/strong> &#8211; The Bot\u00a0endpoint URL, for example,\u00a0<span style=\"color: #0000ff;\">https:\/\/app.asana.com\/api\/1.0\/workspaces<\/span>.<\/li>\n<li><strong>Endpoint Content Type<\/strong> &#8211; 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.<\/li>\n<li><strong>Endpoint Method<\/strong> &#8211; Select one of the following:\n<ul>\n<li><strong>GET<\/strong> &#8211; Specifies an HTTP Request GET method for the task\u00a0field.<\/li>\n<li><strong>POST<\/strong> &#8211; Specifies an HTTP Request POST method for the task\u00a0field.<\/li>\n<\/ul>\n<\/li>\n<li><strong>Response Path<\/strong> &#8211; The path in the response that contains the desired drop-down list values, for example, <span style=\"color: #0000ff;\">data<\/span>.<\/li>\n<li><strong>Label Key<\/strong> &#8211; The key for the label of the drop-down option, for example, <span style=\"color: #0000ff;\">name<\/span>.<\/li>\n<li><strong>Option Value Key<\/strong> &#8211; The key for the value of the drop-down option, for example, <span style=\"color: #0000ff;\">id<\/span>.<\/li>\n<li><strong>Add Payload Field<\/strong> &#8211; 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 <strong>Payload field key<\/strong> and the <strong>Payload field value<\/strong>, and then click <strong>Save<\/strong>. Edit or delete payload fields in the <strong>Actions<\/strong> column.<\/li>\n<li><strong>Editable<\/strong> &#8211; Enables the end-user to enter text free-from in the field as an option when type-ahead search results do not match.<\/li>\n<\/ul>\n<\/li>\n<li><b>Dynamic Check Box<\/b> &#8211;\u00a0Displays 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 <em>JIRA<\/em>\u00a0task notification. Define the following properties for a dynamically populated list of choices as checkboxes.\n<ul>\n<li><strong>Endpoint URL<\/strong> &#8211; The Bot\u00a0endpoint URL, for example,\u00a0<span style=\"color: #0000ff;\">https:\/\/app.asana.com\/api\/1.0\/workspaces<\/span>.<\/li>\n<li><strong>Endpoint Content Type<\/strong> &#8211; The content type expected from the specified endpoint URL. One of: JSON, RSS, XML, Encoded JSON, CSV, or Text.<\/li>\n<li><strong>Endpoint Method<\/strong> &#8211; Select one of the following:\n<ul>\n<li><strong>GET<\/strong> &#8211; Specifies an HTTP Request GET method for the task\u00a0field.<\/li>\n<li><strong>POST<\/strong> &#8211; Specifies an HTTP Request POST method for the task\u00a0field.<\/li>\n<\/ul>\n<\/li>\n<li><strong>Response Path<\/strong> &#8211; The path in the response that contains the desired drop-down list values, for example, <span style=\"color: #0000ff;\">data<\/span>.<\/li>\n<li><strong>Label Key<\/strong> &#8211; The key for the label of the drop-down option, for example, <span style=\"color: #0000ff;\">name<\/span>.<\/li>\n<li><strong>Box\u00a0Value Key<\/strong> &#8211; The key for the value of the drop-down option, for example, <span style=\"color: #0000ff;\">id<\/span>.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<tr>\n<td>Data Type<\/td>\n<td>The data type for the content received from the endpoint URL. One of:<\/p>\n<ul>\n<li><strong>Text<\/strong> &#8211; The user input\u00a0for this filter is expected as text.<\/li>\n<li><strong>Number<\/strong> &#8211; The user input for this filter\u00a0is expected as an integer.<\/li>\n<li><strong>Date<\/strong> &#8211; The user input for this filter\u00a0is a date.<\/li>\n<li><strong>List<\/strong> &#8211; The user input for this filter is a comma-separated list.<\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<tr>\n<td>Operators<\/td>\n<td>Select one or more filter operations that the end-user can select to apply to the filter. Depending on the <strong>Data Type<\/strong> selected, one or more of the following options are available to select to display to the end-user in the filter.<\/p>\n<ul>\n<li><strong>Contains<\/strong> &#8211; The response\u00a0object filtered text contains all\u00a0of the specified values.<\/li>\n<li><strong>Doesn&#8217;t Contain<\/strong> &#8211; The response object filtered text does not contain all\u00a0of the specified values.<\/li>\n<li><strong>Exact Match<\/strong> &#8211; The response object filtered text only contains the specified values.<\/li>\n<li><strong>Not an exact match<\/strong> &#8211; The response filtered text object does not contain the\u00a0specified value.<\/li>\n<li><strong>Included<\/strong> &#8211; The response object filtered text contains\u00a0any of the specified values.<\/li>\n<li><strong>Not Included<\/strong> &#8211; The response object filtered text does not contain any of the specified values.<\/li>\n<li><strong>Starts with<\/strong> &#8211; The response object filtered text begins with the specified\u00a0value.<\/li>\n<li><strong>Doesn&#8217;t start with<\/strong> &#8211; The response object filtered text does not begin with the specified value.<\/li>\n<li><strong>Ends with<\/strong> &#8211; The response object filtered text ends with the specified value.<\/li>\n<li><strong>Doesn&#8217;t end with<\/strong> &#8211; The response object filtered text does not end with the specified value.<\/li>\n<li><strong>Equal to<\/strong> &#8211; The response object filtered numbers or dates\u00a0are\u00a0equal to the specified value.<\/li>\n<li><strong>Greater than<\/strong> &#8211; The response object filtered numbers or dates\u00a0are\u00a0greater than the specified value.<\/li>\n<li><strong>Less than<\/strong> &#8211; The response object filtered numbers or dates are less than the specified value.<\/li>\n<li><strong>Exists<\/strong> &#8211; The response object filtered list contains the specified value.<\/li>\n<li><strong>Doesn&#8217;t exist<\/strong> &#8211; The response object filter list does not contain the specified value.<\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>For multiple filters, you can order the filters\u00a0in an\u00a0order the end-user expects, shown in numerical order in the following illustration.<br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/21\/DIYAlertTaskSettingsTabFiltersSection.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9925\" src=\"\/wp-content\/uploads\/sites\/21\/DIYAlertTaskSettingsTabFiltersSection.png\" alt=\"Alert Task - Settings Tab - Filters Section\" width=\"783\" height=\"303\" \/><\/a><br \/>\nUse the <strong>Move\u00a0Up<\/strong>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"inline\" src=\"\/wp-content\/uploads\/sites\/21\/MoveUpIcon.png\" alt=\"\" width=\"22\" height=\"24\" \/>\u00a0icon and the <strong>Move Down<\/strong>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"inline\" src=\"\/wp-content\/uploads\/sites\/21\/MoveDownIcon.png\" alt=\"\" width=\"22\" height=\"24\" \/> icon in the <strong>Actions<\/strong>\u00a0column in the <strong>Filters<\/strong>\u00a0section to reorder the filters\u00a0if needed.<br \/>\nClick the <strong>Edit<\/strong>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"icon alignnone wp-image-9790 size-full\" src=\"\/wp-content\/uploads\/sites\/21\/EditIcon-1.png\" width=\"16\" height=\"16\" \/>\u00a0icon to modify the settings for an existing filter.<br \/>\nClick the <strong>Delete <img loading=\"lazy\" decoding=\"async\" class=\"icon alignnone wp-image-9789 size-full\" src=\"\/wp-content\/uploads\/sites\/21\/DeleteIcon.png\" width=\"14\" height=\"16\" \/>\u00a0<\/strong>icon to delete an existing filter.<br \/>\n<strong>Warning:<\/strong> This operation\u00a0is permanent and cannot be undone.<\/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 we have seen here, 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 the name, or account, or business. When the alert is set up by the end-user, and the filter applied, only alert messages...","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-27069","post","type-post","status-publish","format-standard","hentry","category-alert"],"_links":{"self":[{"href":"https:\/\/developer.kore.ai\/v9-0\/wp-json\/wp\/v2\/posts\/27069","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=27069"}],"version-history":[{"count":2,"href":"https:\/\/developer.kore.ai\/v9-0\/wp-json\/wp\/v2\/posts\/27069\/revisions"}],"predecessor-version":[{"id":27071,"href":"https:\/\/developer.kore.ai\/v9-0\/wp-json\/wp\/v2\/posts\/27069\/revisions\/27071"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v9-0\/wp-json\/wp\/v2\/media?parent=27069"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v9-0\/wp-json\/wp\/v2\/categories?post=27069"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v9-0\/wp-json\/wp\/v2\/tags?post=27069"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}