Hi @Leung55 :
I'm not sure if I understand your needs, if there are errors, please help me point them out:
- you have multiple rooms
- Each room is booked in units of 15 minutes
- This room can accommodate 20 people
- As long as the capacity of this room in this time unit does not reach the limit, other users can continue to reserve this room.
- You need to display the capacity of a specified room on a specified date in the app and allow users to make reservations.
Something like:

I've made a test for your reference:
1\Add a datepicker control(TheDatePicker) and set it's OnSelelct property to:
ClearCollect(Rooms,{Name:"Room1"},{Name:"Room2"},{Name:"Room3"},{Name:"Room4"});
/*Rooms is the room list*/
ClearCollect(
RemainingCapacity, /*RemainingCapacity is my custom collection*/
AddColumns(
GroupBy(
Filter(
BookList, /*BookList is the SP list*/
Date = TheDatePicker.SelectedDate
),
"Slot",
"NewGroup"
),
"TheRemainingCapacity",
20 - Sum(
NewGroup,
NumberOfUsers
)
)
);
ClearCollect(
ShowInGallery,/*ShowInGallery is my custom collection*/
ForAll(
Sequence(40),
{
SlotNo: Value,
Start: DateAdd(
TheDatePicker.SelectedDate,
480 + 15 * Value - 15,
Minutes
),
End: DateAdd(
TheDatePicker.SelectedDate,
480 + 15 * Value,
Minutes
),
RealRemainingCapacity: 20
}
)
);
ForAll(
RemainingCapacity,
UpdateIf(
ShowInGallery,
SlotNo = Slot,
{RealRemainingCapacity: TheRemainingCapacity}
)
)
2\Add a Slider(Slider1) and set it's Max property to
20
3\Add a gallery(Gallery5) and set it's Items property to
Filter(ShowInGallery,RealRemainingCapacity>=Slider1.Value)
4\Add a label control into Gallery5 and set it's Text property to:
If(ThisItem.RealRemainingCapacity>5,"5+",ThisItem.RealRemainingCapacity)
5\Add a check box(Checkbox1) into Gallery5
6\Add a button and set it's OnSelelct property to
ForAll(
Filter(
Gallery5.AllItems,
Checkbox1.Value
),
Collect(
BookList,
{
Title: Text(
Now(),
DateTimeFormat.LongDateTime24
) & "Ticket",
Date: TheDatePicker.SelectedDate,
Slot: SlotNo,
NumberOfUsers: Slider1.Value,
Creater: User().Email
}
)
);
Select(TheDatePicker)
Best Regards,
Bof