Blocking time slots within a calendar


I’m in the process of creating an appointment app. A consultant will be assigned a task for a certain time of the day. Is it possible than when I want to assign another task to a consultant for that same block of time I only get a dropdown of consultants that are available during the desired time?

Example I have set a task for John from 9 am - 11 am on 04/12/19. I want to assign another task at 10 am - 10:30 am on 04/12/19. For this task John will not be available to select in my dropdown, but if I have a task starting at 1 pm on 04/12/19 John will be available to select.

Provided there will be multiple users in the app other than you, unfortunately there is no way to prevent an over-booking if 2 users are creating an assignment record at the same time. If you are the only user to the app, then it’s possible.

Thank you. I’ll be the only user. I just need an idea of how to do this.