Appointment Booking
# 🤝help
g
Hello Everyone, is it possible to somehow link the clients calendar (google calendar or sth else) to botpress, so the customer is able to choose an appointment from the calendar and book it in the calendar?
b
Hey Sefatih, yes it is possible. The way I'm doing it, depends on requirements, but the general flow is this: 1. Ask client for preferable dates (via direct date input or through raw input - then NLU should extract date from customer's response like 'next week') 2. Gather information what service or appointment type he needs (if it is necessary) 3. Execute code block like this (Calendly): function composeCalendlyUrl() { const baseUrl = 'https://calendly.com/mateuszpoland/free-consultation' let fullUrl = baseUrl let pickedDate = workflow.user_appt_date if (null !== pickedDate) { fullUrl += '?date=' + pickedDate } workflow.calendly_url = fullUrl } composeCalendlyUrl() and then show user the link to appointment booking in the next card: Please, follow link to book your appointment: @calendly_url
r
How do you do the transition from raw to date? Is the NLU work automatically or that you need to set something?
b
there are built-in entities in botpress and one of them is DateTime they are automatically extracted and stored in event.nlu.entities you can create a custom hook, that will go over this extracted entities, after incoming message. If NLU extracted date from users input, you will find it there. Example: if ('entities' in event.nlu && Array.isArray(event.nlu.entities) && event.nlu.entities.length > 0) { for (let i = 0; i < event.nlu.entities.length; i++) { const entity = event.nlu.entities[i] console.log(entity) if (entity.type == 'DateTIme') { // save in workflow var } } } this is roughly how you can dig into it. But a simplier alternative will be to just present the user DateTIme card and extract it directly, as nlu can interpret this input incorrectly
g
Thx for your input @busy-printer-481 . For someonelike me with nearly zero coding experience, this looks very difficult 😅. I thought botpress would be more no-code friendly
o
here i what i did as per screenshot. i collected information from user at consultation_booking and sent to zapier then created another card named "calendly" where i asked user as "Please tell when your available to book ?" which is stored in Datetime. so, next what i want to do is depending on when user says they are available i want bot to search in calendly and display data to user some options available on particular date. please explain how to do this. @busy-printer-481

https://cdn.discordapp.com/attachments/1136067387104440331/1136812264331165777/appointment.png

71 Views