Hi all,
I'm making a room booking app connected to an excel spreadsheet on OneDrive. I have 3 dropdown controls; selecting a specific room, a date picker for the start date of booking and a date picker for the end date of the booking. I want to be able to handle logic where if the selected room is already booked between the start date and end date, then the button submit control, which patches the bookings, is disabled. The excel spreadsheet is called 'Bookings'.
I've tried a few things, for end date picker on select property I've got the below code. I've tried to use a For All function to cycle through all records in the source Bookings database, if a selected room has start and end date which is already within the Bookings database then it displays a notification and is meant to disable the submit button however it displays the notification but does not disable the submit button. Open to alternative suggestions. I've tried cycling through the records and creating a collection for matched records and then selecting the submit button property to disabled if the collection is not empty but haven't been able to make this work.
ForAll(Bookings,If(And(Value(RoomID)=Value(LookUp(Referencetable,
RoomName=Roomselector.Selected.RoomName).RoomID),Start.SelectedDate>=StartDate,
End.SelectedDate<=EndDate),Notify("Room selected is already booked between those
dates!";,NotificationType.Information);Bookingsubmit.DisplayMode.Disabled))
Stay up to date on forum activity by subscribing.
stampcoin
73
DS-11051211-0
20
MS.Ragavendar
9