It seems like quite a few of us are wondering how to let Users setup their daily availabilities. This is useful if your app involves appointment scheduling or business opening/closing hours for example.
This demo is not on a paid plan therefore the loading time when ‘Start’ is clicked is very long. You can make this seamless by creating the availabilities in an API workflow instead
This is certainly not the only way to do it, so if anyone has suggestions to make it better please feel free to share
Here are a few extra guidelines:
You need to create a data type Availabilities with the following fields:
Available (of type yes/no)
Day (of type text)
DayNumber (of type number)
OpeningHour (of type date)
ClosingHour (of type date)
Add a field Availabilities (list of Availabilities ) to your User data type
When User is created, create 7 new Availabilities (one for each day) and add them to User’s Availabilities
Day: Sunday; Monday; Tuesday and so on
DayNumber: 0; 1; 2; 3; 4; 5; 6 (Sunday = 0; Monday = 1, Tuesday= 2 and so on)
To let the User define his availabilities, create a RG (7 rows, 1 column) and set the data source to Current User’s Availabilities . Each row is one day. Include the following elements in the first cell, from left to right:
1 checkbox (set to Dynamic: Current cell’s Availabilities’ Available )
1 text (set to Current cell’s Day )
2 date/time pickers, one for the OpeningHour and the other for the ClosingHour - I recommend using this plugin by @seanhoots
Create following workflows:
When checkbox’s value is changed and checkbox is checked > Make changes to Current cell’s Availabilities: Available = yes
In the same way, when checkbox’s value is changed and checkbox is unchecked > Make changes to Current cell’s Availabilities: Available = no
When AirDate/TimePicker A’s value is changed > Make changes to Current cell’s Availabilities: OpeningHour = This AirDate/TimePicker’s value
In the same way, when AirDate/TimePicker B’s value is changed > Make changes to Current cell’s Availabilities: ClosingHour = This AirDate/TimePicker’s value
Hope this helps and happy to answer any questions you might have
@Boost do you mean if the User is available from say monday 8pm to tuesday 2am for example? That’s a good point. With that current configuration the User would have to pick 11:59pm for monday’s closing hour and tuesday 12:00am for tuesday’s opening hour so there is no interruption on his calendar
Just curious @ambroisedlg, how would you set it up if someone wanted to create multiple chunks of time within a day? (So that users can take breaks)
For ex. Monday 8am-11am, 1pm-5pm, etc
Edit: I guess that part would be easy, the hard part is allowing users to book out certain chunks of time, while taking that out of the available times.
I tried using the plugin you recommended, but from I remember, there were some limitations on date ranges and filtering out times, since it only had a minimum and maximum date
@Boost One way to do it is to create an Event from 11am to 1pm for example. In the user’s calendar, do a search for Events overlapping with the timeslot. If the count >0, make the time slot not clickable, therefore not bookable
Define the start time and end time of the day, or of each day if the week (opening hours) then setup a backend workflow to split your day’s hours in time slots. You can also add the timeslots duration as a parameter of the workflow (15 min, 30 min, 1 hour,…)
Perfect! And do you know how can I display it on the app so the user can select different times? When the user clicks on ADD I would like a new line to appear to select different hours within the same day! Thank you. Messages Image(203513258)|537x500