Building a dynamic scheduling assistant with Zobot!

Building a dynamic scheduling assistant with Zobot!

We received requirement for a bot that can dynamically generate date-time slots which do not overlap existing event timings in Google Calendar ie., if a slot is booked then it will fade away from the time-slot widget.

Bot Requirements:    
A bot that can:  
  • Construct dynamic non overlapping date-time slots  
  • Exclude a specific date or week days while generating the slots 

What does this Zobot do ?  

  • When a visitor lands on the site, the bot displays a welcome message and asks for the visitor's name and email.
  • The bot will then display a list of date-time slots for the visitor to pick one to schedule the appointment. The slots displayed:
                        a) Do not overlap any existing appointments or events in the synced Google Calendar.
                        b) Do not include any dates in 'dates to exclude' and 'days to exclude' lists that were configured by you.
  • Once the visitor picks a slot, an event is created in the synced google calendar. The slot hence forth will not be displayed to visitors anymore.
  • If every slot has been filled and there are no slots to display, the Zobot will display a 'Sorry' message to the visitor and send out an email to a configured email ID with the visitor details. 

Bot flow :



Capabilities: 

  • Dynamic date-time slot generation : Generate and display slots that do not overlap existing appointments and events 
  • Configurable list : You can include/exclude any number of dates and days in the calendar. You can configure the slots that should be initially available for all the dates and the number of dates from the current date to display in the slot . 

Integrations : 

  • Google Calendar : To retrieve events in the calendar 
Steps to configure the bot :

      1. Navigate to  Settings > Zobot > Add. Provide the required information and choose the SalesIQ Script platform.   
      2. Copy and paste the Trigger Handler and Message Handler scripts from the sample script link below.
      3. You should make the following changes in both Trigger Handler and Message Handler scripts: 
                  •   You should mention the number of dates to be display in the 'dateLimits' list.
                  •   Add the the Initial set of time slots to be displayed for all the dates in 'staticTimeSlots' list.
                  •   Mention the dates you wish to exclude from the list in the 'datesToExclude' list.
                  •   If it is Week days ie., (Monday or Tuesday) you wish to exclude then mention the days in the 'daysToExculde' list.
  1.  //Number of dates to display
  2.  dateLimits = {"1","2","3","4","5","6","7","8","9","10"};
  3. //Static time slots that will be initially available for all days
  4. staticTimeSlots = {"10:00","12:00","15:00","17:00"};
  5. //Dates to exclude from the slots
  6. datesToExclude = {"02-04-2019"};
  7. //Days to exclude from the slot
  8. daysToExclude = {"Sunday","Saturday"};
                To integrate with google calendar, 
                  •   Replace the existing one with your connection name
                  •   Replace the calendar ID (if required.) By default, the events are created in the primary calendar of the synced Google account.    
  1. cal = invokeurl
  2. [
  3.      url :"https://www.googleapis.com/calendar/v3/calendars/Calendar-ID/events"
  4.     type :GET
  5.     connection:Google-calendar-connection-name
  6. ]

     4. Then, copy the context handler script from the sample script link below and paste it in the Zobot Context handler  section and make the following changes 
            •  You should customise the email recipient address and the email subject and body content
  1. sendmail
  2. [
  3.     from : zoho.adminuserid
  4.     to : recipient-email-id 
  5.     subject : email-subject 
  6.     message : email-body
  7. ]

To avail the sample scripts for this bot click on this link  

Here is a small visual as on how this bot works:

 

To learn more about Zobot, visit our Developer guides. Happy Zobotting !!

Regards, 
Fiaz  

      Zoho Developer Community









                                Zoho Desk Resources

                                • Desk Community Learning Series


                                • Digest


                                • Functions


                                • Meetups


                                • Kbase


                                • Resources


                                • Glossary


                                • Desk Marketplace


                                • MVP Corner


                                • Word of the Day



                                    Zoho Marketing Automation


                                            Manage your brands on social media



                                                  Zoho TeamInbox Resources

                                                    Zoho DataPrep Resources



                                                      Zoho CRM Plus Resources

                                                        Zoho Books Resources


                                                          Zoho Subscriptions Resources

                                                            Zoho Projects Resources


                                                              Zoho Sprints Resources


                                                                Qntrl Resources


                                                                  Zoho Creator Resources



                                                                    Zoho WorkDrive Resources



                                                                      Zoho Campaigns Resources


                                                                        Zoho CRM Resources

                                                                        • CRM Community Learning Series

                                                                          CRM Community Learning Series


                                                                        • Tips

                                                                          Tips

                                                                        • Functions

                                                                          Functions

                                                                        • Meetups

                                                                          Meetups

                                                                        • Kbase

                                                                          Kbase

                                                                        • Resources

                                                                          Resources

                                                                        • Digest

                                                                          Digest

                                                                        • CRM Marketplace

                                                                          CRM Marketplace

                                                                        • MVP Corner

                                                                          MVP Corner





                                                                            Design. Discuss. Deliver.

                                                                            Create visually engaging stories with Zoho Show.

                                                                            Get Started Now