Appointment Management with Dynamic Drop Down

Appointment Management with Dynamic Drop Down

Requirement  

Allow patients to book appointments with their doctors.

Use Case  

A clinic wants to digitize its booking system. There are multiple specialists and different dates/times for appointments. Each appointment lasts for 30 minutes. There are two forms: the Doctor form, to add the details of specialization and availability of the doctors who visit, and the Appointment form to book an appointment.
 

Steps to follow  

1. Create the forms with the following details:
Form
Form Link Name
Field Type
Field Name
Field Link Name
Doctor
Doctor
Name
Doctor Name
Doctor_Name
Drop Down
Specialization
Specialization
Time
From
From
Time
To
To
Appointment
Appointment
Name
Patient Name
Patient_Name
Phone
Phone
Phone_Number
Lookup (Doctor)
Doctor Name
Doctor_Name
Drop Down
Date of Appointment
Date_of_Appointment
Drop Down
Appointment Slot
Appointment_Slot

Add a few fields of specialization to the Specialization choices -> (General, Gynacology, Obstetrics, Neonatalogy, Pediatrics, Dermatology, Ophthalmology, Cardiology, Pulmonology).
 
2. Insert a few records to the Doctor form.
 
3. Let us now create a workflow to populate dates in the Date of Appointment field in the Appointment form. A patient is allowed to book appointments for the next five days. We shall create a workflow to execute during the load of the Appointment form.
 
4. Click Add New Action and add the below code in Deluge Editor:
  1. //Booking from the next day
  2. startDate = zoho.currentdate.addDay(1);

  3. //Allow booking for the next 5 days
  4. endDate = startDate.addDay(4);

  5. //Loop through the dates and add them to the Date of Appointment drop down field. We need the next five dates. Hence adding 5 elements to a list. For adding more dates, check Points To Note.
  6. list = {1,2,3,4,5};
  7. for each index l in list
  8. {
  9.  input.Date_of_Appointment:ui.add(startDate.toString());

  10. //update startDate to get the next date
  11.  startDate = startDate.addDay(1);
  12. }
 
5. In the same way, after a Date of Appointment is selected, the slots available in those days for the chosen doctor should be populated in the Appointment Slot field.
 
6. Click Add New Action and add the below code in the Deluge Editor:
  1. //Take the details of the chosen doctor
  2. doctor = Doctor[ID == input.Doctor_Name];

  3. //Getting the visiting hours of the doctor chosen
  4. from = doctor.From;
  5. to = doctor.To;

  6. //Getting the hours
  7. diff = from.hoursBetween(to);
  8. selectedSlots = List();

  9. //To get already selected slots for the chosen doctor on the chosen date
  10. for each d in Appointment[Doctor == input.Doctor_Name && Date_of_Appointment == input.Date_of_Appointment]
  11. {
  12.  selectedSlots.add(d.Appointment_Slot);
  13. }

  14. //Multiplying the number of hours by 2, since each appointment is assumed to be 30 minutes
  15. //We are padding diff * 2 number of spaces to 1 and then we are changing the spaces to 1. This will now help us to add diff * 2 number of slots from which the patient can choose.
  16. //We are using the below list to control the number of iterations in the following loop.
  17. list = leftpad("1",diff * 2).replaceAll(" ","1,").toList();
  18. for each index a in list
  19. {

  20. //Add the slot only when it is not already selected by another patient
  21.  if(!selectedSlots.contains(from.toString()))
  22.  {
  23.   input.Appointment_Slot:ui.add(from);
  24.  }

  25. //Find the next slot by adding 30 minutes.
  26.  from = from.addMinutes(30);

See how it works         

           

Points to Note  

  • To add more dates, check the below code:
  1. startDate = zoho.currentdate.addDay(1);

  2. //Allow booking for the next 30 days
  3. endDate = startDate.addDay(30);
  4. list = leftpad("1",30).replaceAll(" ","1,").toList();
  • The field type of From and To in the Doctor form is Time. Thus, the time difference can be a little difficult to calculate sometimes. We can have them as Date-Time fields too.  

    Zoho CRM Training Programs

    Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.

    Zoho CRM Training
      Redefine the way you work
      with Zoho Workplace

        Zoho DataPrep Personalized Demo

        If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.

        Zoho CRM Training

          Create, share, and deliver

          beautiful slides from anywhere.

          Get Started Now


            Zoho Sign now offers specialized one-on-one training for both administrators and developers.

            BOOK A SESSION





                        Still can't find what you're looking for?

                        Write to us:  support@zohoforms.com

                                                                       
                            



                            





                              You are currently viewing the help pages of Qntrl’s earlier version. Click here to view our latest version—Qntrl 3.0's help articles.




                                  Manage your brands on social media

                                    Zoho Desk Resources

                                    • Desk Community Learning Series


                                    • Digest


                                    • Functions


                                    • Meetups


                                    • Kbase


                                    • Resources


                                    • Glossary


                                    • Desk Marketplace


                                    • MVP Corner


                                    • Word of the Day


                                      Zoho Marketing Automation

                                        Zoho Sheet Resources

                                         

                                            Zoho Forms Resources


                                              Secure your business
                                              communication with Zoho Mail


                                              Mail on the move with
                                              Zoho Mail mobile application

                                                Stay on top of your schedule
                                                at all times


                                                Carry your calendar with you
                                                Anytime, anywhere




                                                      Zoho Sign Resources

                                                        Sign, Paperless!

                                                        Sign and send business documents on the go!

                                                        Get Started Now





                                                                Zoho TeamInbox Resources



                                                                        Zoho DataPrep Resources



                                                                          Zoho DataPrep Demo

                                                                          Get a personalized demo or POC

                                                                          REGISTER NOW


                                                                            Design. Discuss. Deliver.

                                                                            Create visually engaging stories with Zoho Show.

                                                                            Get Started Now










                                                                                                • Related Articles

                                                                                                • Appointments Management

                                                                                                  This app is published in accordance with Marketplace review process. For pricing details, you can refer to this page. Category - IT and Administration Vendor - Zoho Corporation Pricing - Free Overview Schedule and streamline your service appointments ...
                                                                                                • Dynamic help text while filling a form

                                                                                                  Requirement   Display tooltips for fields and dynamic help texts for picklist (radio or drop-down) choices. Use Case   The careers page on a salon website contains a form listing the current openings for stylists. A dynamic text displays the ...
                                                                                                • Filter report using dynamic values from a function

                                                                                                  Requirement When a user accesses a report, data is filtered based on the logged-in user's role so that only the required details are visible to the user. Use Case An employee management system has two forms, Department and Employees. The Department ...
                                                                                                • Understand drop down field

                                                                                                  Understand Drop down fieldThe Drop Down field enables your users to select a value from a predefined set of choices that are displayed in a dropdown menu. When to use this field?You may consider the following pointers to determine when to use a drop ...
                                                                                                • Dynamic calculation of price based on the calculated distance

                                                                                                  Requirement Calculate the cost of a taxi or hired car based on distance. Use Case A cab booking application calculates and displays the approximate cost of a trip based on pickup and drop-off addresses, after which the user can choose to book the ...
                                                                                                Wherever you are is as good as
                                                                                                your workplace

                                                                                                  Resources

                                                                                                  Videos

                                                                                                  Watch comprehensive videos on features and other important topics that will help you master Zoho CRM.



                                                                                                  eBooks

                                                                                                  Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho CRM.



                                                                                                  Webinars

                                                                                                  Sign up for our webinars and learn the Zoho CRM basics, from customization to sales force automation and more.



                                                                                                  CRM Tips

                                                                                                  Make the most of Zoho CRM with these useful tips.



                                                                                                    Zoho Show Resources