Showing available rooms using time slot filtering
Options
![yashwin](https://us.v-cdn.net/6037124/user_avatars/1485393.jpg)
yashwin
Member ✭
Hey everyone!
I'm trying to display all available meeting rooms with a condition of only showing meeting rooms that are not booked for a user given time period
Some context :
Booking table contains startTime, endTime and meetingRoom Id
Meeting room table contains information relevant to the room like name, pictures etc
What I've tried
Using a join (meeting room & booking data tables) and put a condition where user start time is not equal to booking.startTime. As you can imagine, it's not working
Any suggestions on what I can try doing?
I'm trying to display all available meeting rooms with a condition of only showing meeting rooms that are not booked for a user given time period
Some context :
Booking table contains startTime, endTime and meetingRoom Id
Meeting room table contains information relevant to the room like name, pictures etc
What I've tried
Using a join (meeting room & booking data tables) and put a condition where user start time is not equal to booking.startTime. As you can imagine, it's not working
Any suggestions on what I can try doing?
Comments
-
Hey - this might be a good use case for Addons. Quick question - is user start time pulled from the user table or is it an input?
-
Hey Michael 👋
It's an input from the front end. Once the user is done selecting a date time filter, I'll be sending a GET API request with all necessary input values to Xano
My hope is that if I'm able to get this to work, I want to see how far I can push filtering by adding more conditions
[Desktop_-_1.jpg]front end for your reference -
Thank you- here's me talking about how you will want to think about doing this both from a DB perspective and API/task perspective
-
thank you for the walk through!
I had initially thought about doing this but I ran into some logic problems
Like, if a user wants to book meeting rooms for 2 hours, I can in the booking table book out two slots.
but on the front end, they would input for example, 4pm - 6pm available meeting rooms, which in this example would return 2 results for the same meeting room. One result for 4pm-5pm and the next for 5-6.
Another minor concern I had was the amount of rows this would create in the db, even if it's a small space with 4 rooms (4 * 12 slots * 30 days)
Maybe I'm doing something wrong or maybe approaching the problem from the front end wrong? -
If a user wants to book multiple blocks of time. In this example, each block is an hour so 2 blocks = 2 hours, then you will want to do a For Each Loop through each block the user wants to book and nest your Edit Record function to edit each record returned.
Yes, you will be creating a lot of records for this table. You will want to determine how far out in the future you want to show availability (e.g. 1 week, 2 weeks, 1 month, etc.) You can also consider a background task to delete records if you don't need a history of them after however long.
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback