cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JolienS
New Member

Checking availability for multiple dates

Hi,

 

I am trying to check if a room is available for multiple dates. If so, the room may be shown in a gallery.
'Lijst_Reservaties_ Zalen /lokalen’ is the list containing all rooms.

'ListReservations' is the list of all reservations. In 'ListHerhaling' I have put all the data that the user has selected and which must therefore be checked.


Van is the column in 'ListReservations' that contains the start date and time.
Start is the column in 'ListHerhaling' that contains the start date and time in text format.
Tot is the column in 'ListReservations' that contains the end date and time.
Eind is the column in 'ListHerhaling' that contains the end date and time in text format.


My code at the 'Items' property of the gallery:

Filter('Lijst_Reservatie_Zalen/lokalen'; Not(ID in Filter(ListReservations; 
CountIf(ListHerhaling; (
    (Van >= Value(Start) && Tot <= Value(Eind)) || 
    (Van < Value(Eind) && Tot >= Value(Eind)) || 
    (Van < Value(Start) && Value(Start) < Tot))) > 0).ID_Zaal))

 

I have already tried everything but I don't find it. I would be super grateful if you could help me.

Thank you! 

2 REPLIES 2
CNT
Super User
Super User

@JolienS Could u please tell what's the difference between your ListReservations' and 'ListHerhaling' table?

JolienS
New Member

Hi @CNT 

 

The 'ListReservations' is a table with all reservations already booked for all rooms by all users.

It is the intention that several moments can be reserved at once. To give an example, the start date entered is 18/05 and the end date 8/06 and the user wants the reservation to repeat every other week. 18/05, 25/05, 01/06 and 8/06 are then stored in 'ListHerhaling' with a start and an end date and time. So 'ListHerhaling' is a collection that I use to store all dates.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,414)