how to add date picker inside dialogflow parameters

Viewed 588

I have a chatbot created in Dialogflow ...and i want to add a calendar date picker in the moment i ask for the date of the meeting for example this is how is looked now The webhook ( in javascript) related with this intent is :

 function makeAppointment (agent) {

        const appointmentDuration = 1;// Define the length of the appointment to be one hour.

        const dateTimeStart = convertParametersDate(agent.parameters.date, agent.parameters.time,timeZoneOffset);
        const dateTimeEnd = addHours(dateTimeStart, appointmentDuration);
        const appointmentTimeString = getLocaleTimeString(dateTimeStart);
        const appointmentDateString = getLocaleDateString(dateTimeStart);

        return createCalendarEvent(dateTimeStart, dateTimeEnd).then(() => {
            agent.add(` Danke vielmals `);
        }).catch(() => {
            agent.add(` Es tut mir leid`);
        });
    }

This version is used in facebook ...now i'm working for web version of the chatbot( created in angular) . What i'm looking is : chatbot ask for parameter date for example ...to display the calendar and user to pick the date from the calendar ( not to type it)

Do you have any idea how to do this ?

1 Answers

Well, if you are using web I can recommend using Kommunicate. It integrates with dialogflow and has multiple rich content elements, including forms, date picker and HTML. For facebook I don't thing there is anything yet.

Maybe you can create code to use the quick replies to elaborate different buttons with available times and one for more options to call a followupevent to teh same intent and recreate quick replies with new dates. You can have 8 of them at a time.

Related