I have a room reservation PowerApps that saves the reservations in a SharePoint list called Room Reservations
The Room Reservation list has the following columns:
Room: Choice column
Date: date column
FromTime: choice column that has time choices from 6:00 AM till 11:00 PM
ToTime: choice column that has time choices from 7:00 AM till 12:00 AM
in the newBooking screen in my power app I have:
Room: dropdown (that display the choices of the Room column of the Room Reservation list)
Date: Datepicker
From: dropdown (that display the choices of the FromTime column of the Room Reservations list)
To: Dropdown (that display the choices of the ToTime column of the Room Reservations list)
Submit button: that saves reservation in the Room Reservations List
I want the app to filter the available time slots in the fromDropdowns based on the room and date selection, ensuring that only unreserved time slots for the selected room and date are shown.
Please note that: When a person submits, they can choose a more than 1 hour time slot, for example 8:00 AM - 11:00 AM.
in the fromDropdown.Items I have this code:
Filter(
Choices('Room Reservations'.FromTime),
Time(
Hour(
LookUp(
'Room Reservations',
Room.Value = Dropdown1_17.Selected.Value,
Date = DatePicker1_5.SelectedDate
).FromTime
),
Minute(
LookUp(
'Room Reservations',
Room.Value = Dropdown1_17.Selected.Value,
Date = DatePicker1_5.SelectedDate
).FromTime
),
0
) >= Time(
Hour(Value),
Minute(Value),
0
) &&
!(
CountRows(
Filter(
'Room Reservations',
Room.Value = Dropdown1_17.Selected.Value,
Date = DatePicker1_5.SelectedDate,
Time(
Hour(
LookUp(
'Room Reservations',
Room.Value = Dropdown1_17.Selected.Value,
Date = DatePicker1_5.SelectedDate
).FromTime
),
Minute(
LookUp(
'Room Reservations',
Room.Value = Dropdown1_17.Selected.Value,
Date = DatePicker1_5.SelectedDate
).FromTime
),
0
) >= Time(
Hour(Value),
Minute(Value),
0
) &&
Time(
Hour(
LookUp(
'Room Reservations',
Room.Value = Dropdown1_17.Selected.Value,
Date = DatePicker1_5.SelectedDate
).FromTime
),
Minute(
LookUp(
'Room Reservations',
Room.Value = Dropdown1_17.Selected.Value,
Date = DatePicker1_5.SelectedDate
).FromTime
),
0
) < Time(
Hour(Value) + 1,
Minute(Value),
0
)
)
) > 0
)
)
It seems that the Time function does not accept .FromTime , I am getting errors that I'm having invalid use of '.'
Any Ideas what to do?

Report
All responses (
Answers (