I'm creating Hotel Reservation App

I have a Table App called “Booking” and “Rooms” with Many to many relation using EnumList, and List with Select strategy. Now everthing went well but I now got one last problem.

That how do I validate that the current booking Rooms are valid and available on those days to create a new booking?



1 8 290
8 REPLIES 8

Question is not really clear to me. However, so far I could understand you can do the job in many way. One is that based on the date, you can use “Valid If” Event to either validate or make the room available. Another is that create a slice based on the date to check the available Rooms. Or you can keep a flag/Status which will be updated once the client checked out.

Thank you, I’m going for the creating slices way. I think there is no way to escape to not using the Valid If feature.

Thanks

HI!
If you use ENUMLIST for the Rooms, you may need to use IN expression. Just share my views.

Wish your success.

Hi @Tech_Service
I would advice you to not use Slices in this case.
A good Suggested Values expression could do the trick.
Make sure to have a column on your Rooms table that could be used to get if it’s available or not.
This should be a pretty straight foward thing from my POV but we need more info to help.
Tell us about your table’s schema (Names, configs, etc) so we can come up with a expression for you to try

I Created a slice and it work just fine for getitng a view for a separated situation. I used below code for Row filter Condition and it works just fine.

“AND([Checkin]<=TODAY(),[Checkout]>TODAY())”

However, I’m trying to get available room while the booking is happening on a specific date. So I tried this below code in the VALID IF box

ROOMS[ROOMID] - SELECT(Bookings[ROOMS][ROOMID],AND(Bookings[Checkin]<=[_THISROW].[Checkin],Bookings[Checkout]>[_THISROW].[Checkin]))

But still not working

The record for each booking needs to be edited in the future? Just to help you with the right valid if

I have used the Tables as follows. Hotel_Demo is the Room Reservation Table and Hotel_Room is the Room basic Table or you can say Room Parent table. Anyway, if you use the expression in the ‘Valid If’ of the [RoomID] field of the Hotel_Demo Table as follows, it will filter on the form of Hotel Reservation Form based on Hotel_Demo.

(Hotel_Room[RoomID]-(SELECT(Hotel_Demo[RoomID],AND(
ANY(Hotel_Demo[StartDate])<=[_THISROW].[StartDate],ANY(Hotel_Demo[EndDate])>=[_THISROW].[EndDate]))))

Instantly I designed and tested, it works fine. Maybe you need to fine tune. Check it and have discuss. I am from Malaysia and I study AppSheet community after my office hour at night. Anyway, Hope it will help you.



Thank you for your time.

Top Labels in this Space