Q&A

Datetimepicker with Dialogflow

A little help would be greatly apprecitated for this newbie.

I've used Line Bot Designer's DateTimePicker Template as a Custom Payload on Dialogflow.

{ "line": { "altText": "this is a buttons template", "type": "template", "template": { "actions": [ { "min": "2019-06-20", "initial": "2020-06-20", "type": "datetimepicker", "label": "Start", "max": "2021-06-20", "data": "Data 1", "mode": "date" } ], "title": "Start/Finish", "type": "buttons", "text": "Please select" } } }

The datetime picker appears when testing and can be scrolled but nothing is returned after submitting. I'm bit confused about the next steps. Ideally, I'd like a message with date confirmation next. Would a simple 'postback' work or do I need a replyToken. If the latter, how is this generated?

Many thanks in advance.

  • 0
  • 2
  • 121
  • twitter facebook

This is the Dialogflow limitation. Dialogflow will only accept the message - text event. But the DateTimePicker Action will return the Postback event. So dialogflow will reject to read this event from LINE Messaging API. My recommanded workaround is to develop a datetime picker with JS and HTML and use LIFF (liff.sendMessage()) to send the data back to LINE with a Normal Text Message Type.

  • 1

Many thanks Siratee! Much appreciated. I'll take a look at your suggestion.

  • 1
本当によろしいですか? question.vm