Hello,
I have two lists: "Desk" and "DeskReservations" list.
In my "Desk" list I have the following:
ClearCollect( Desk, { Title: "Room 1", Capacity: 2}, { Title: "Room 2", Capacity: 2}, { Title: "Room 3", Capacity: 4}, { Title: "Room 4", Capacity: 2}, { Title: "Room 5", Capacity: 3} )
In my "Desk Reservations" list I have the following:
ClearCollect( DeskReservations, { Title: "Room 1", ReservedBy: some name, Datebooked: 23/10-2022}, { Title: "Room 1", ReservedBy: some name, Datebooked: 23/10-2022}, { Title: "Room 2", ReservedBy: some name, Datebooked: 23/10-2022}, { Title: "Room 2", ReservedBy: some name, Datebooked: 24/10-2022}, { Title: "Room 3", ReservedBy: some name, Datebooked: 23/10-2022}, { Title: "Room 4", ReservedBy: some name, Datebooked: 23/10-2022}, { Title: "Room 1", ReservedBy: some name, Datebooked: 24/10-2022} )
I want to filter my "Desk" list in a way so that I only get items that has still capacity in a particular date. For Example: lets say the date is 23/10-2022. Then by looking at my "DeskReservations" list. I can see that I have Room 1 booked 2 times in 23/10-2022. Since Room 1 only has the capacity of 2 then I know that I cannot book it that day and thus it should not be one of the items in my "Desk" list after filtering. After filter the items available in my "Desk" list should be:
{"Room 2", "Room 3" "Room4, "Room 5"}
How can I achieve that? I have been struggling with what conditions I should have in my filter function to achieve it.. Any help appreciated! thanks!

Report
All responses (
Answers (