0

I built a chatbot with Watson Assistant and integrated it with Slack. I added a date picker provided by Slack Block Kit Builder into the watson assistant dialogue node json like this:

{
  "output": {
    "generic": [
      {
        "channels": [
          {
            "channel": "slack"
          }
        ],
        "user_defined": {
          "blocks": [
            {
              "text": {
                "text": "Pick a date for the deadline.",
                "type": "mrkdwn"
              },
              "type": "section",
              "accessory": {
                "type": "datepicker",
                "action_id": "datepicker-action",
                "placeholder": {
                  "text": "Select a date",
                  "type": "plain_text",
                  "emoji": true
                },
                "initial_date": "1990-04-28"
              }
            }
          ]
        },
        "response_type": "user_defined"
      }
    ]
  }
}

and here is what it looks like in slack: datepicker

But after I select a date, the chatbot seems to do nothing with it.

How can I make Watson Assistant remember or save the date picked? For example, I expect that after a date is picked, the chatbot can repond with something like 'Are you sure that you will make an appointment at the picked date' .

Rachel Dong
  • 179
  • 1
  • 3
  • 11
  • Is the date picker part of Slack or how did you build it? Do you use the official Watson Assistant / Slack integration? How is the dialog started? You only show the date picker. – data_henrik Jul 20 '21 at 06:16
  • Yes I used the official Watson Assistant/Slack integration. I have editted my question to show how I realize the date picker, please I have a look at the question body. – Rachel Dong Jul 20 '21 at 06:44
  • How do you enter text and send it over to Watson Assistant? – data_henrik Jul 20 '21 at 10:23
  • Just type the plain text in the input box of slack, it will send the text to WA automatically, and WA will send the response back to slack. When the chatbot asks the user to input a date, instead of typing the date, user can choose a date from the drop-down menu. So I thought the selected date will be sent to WA automatically just like the plain text and I can access it via in WA, but actually I can't. – Rachel Dong Jul 20 '21 at 12:41
  • I have used that Slack integration for this tutorial (https://cloud.ibm.com/docs/solution-tutorials?topic=solution-tutorials-slack-chatbot-database-watson), that's why I am asking. Apparently, the sending is not happening. So your field with the date picker also has a free form field? – data_henrik Jul 20 '21 at 13:06
  • I think we used the same slack integration method. I expect that the date picker works like a 'button', if I click a button with certain value, Assistant can receive the value and match it with an intent and activate the corresponding dialogue node, so if I pick a date, I suppose Assistant could also receive the date value, but the reality is, as you said, after I select a date, the sending is not happening, I want to know why slack can send a button value to Assistant, but doesn't send a datepicker value? – Rachel Dong Jul 20 '21 at 15:17
  • Hi, Can it be that that the control you are using is of type: section and not type:input? Can you check this documentation : https://api.slack.com/reference/block-kit/blocks#input ? – Suyash Gaur Jul 22 '21 at 10:27
  • @RachelDong I just confirmed the integration is not supporting the type of slack `action` ( buttons and menues are supported). I can raise it as a feature request – Dudi Jul 22 '21 at 18:29
  • @SuyashGaur I have tried the input type but nothing happens. According to Dudi said, I think Watson cannot receive the event generated by datepicker at current time. – Rachel Dong Jul 27 '21 at 07:52
  • @Dudi Thank you for reply:) Hope the feature will be realized soon. Maybe I need to think about another way to get it work at current time. – Rachel Dong Jul 27 '21 at 07:54

0 Answers0