cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ecrevisse
Helper II
Helper II

Filter gallery

I have a SharePoint database with rooms and a SharePoint database with Reservations. I have a gallery prepared. How can I display only the rooms available on the day of booking in this gallery? How to filter and enable booking. 

Screen Shot 06-23-21 at 03.43 PM.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
ecrevisse
Helper II
Helper II

Hi @C-Papa i have only one booking date. I don't have end date. I have only star date because user can't book range date.  I use this component  form April PowerApps/Calendar Component (4).msapp at master · aprildunnam/PowerApps · GitHub. Will you correct for me your formul ?  i will be gratefull 🙂 

View solution in original post

5 REPLIES 5
C-Papa
Solution Sage
Solution Sage

Hi, this can be fairly complicated, can people book a room for more than one day at a time?

@C-Papa They can book for more than one day. The scenario assumes only reservations for a day without an hour.

@C-Papa  what do you think ? It is possible ?

C-Papa
Solution Sage
Solution Sage

hi, so you would need a datepicker for the start date (DatePicker1) and a date picker for the end date (DatePicker2)

 

OnChange of the date picker you would collect the Reservations list where the end date is within the date period selected, as if it is, the room is unavailable. e.g.

OnChange of date pickers:

ClearCollect(Col_ Reservations,Filter(Reservations, EndDate => DatePicker1.SelectedDate && EndDate =< DatePicker2.SelectedDate))

 

Within the Reservations list i would suggest using the Title field as the ID of the room that is selected when a booking is made.

 

On the start of the app i would collect the rooms list e.g. ClearCollect(Col_Rooms, RoomsList)

 

change your gallery items to Col_Rooms

 

Within your gallery add a button to book the room and set its displaymode to

 

If(IsBlank(LookUp(Col_ Reservations,Value(Title) = ThisItem.ID)),Displaymode.Edit,Disabled)

 

if the room is available the button will be active (Displaymode.Edit), if its not it will be disabled. you can then change the onselect of the button to navigate to a form if the room is available where you can complete your booking. once the booking is complete you will need to add the booking to the Col_ Reservations collection so that when you return to the gallery that room is no longer available. 

ecrevisse
Helper II
Helper II

Hi @C-Papa i have only one booking date. I don't have end date. I have only star date because user can't book range date.  I use this component  form April PowerApps/Calendar Component (4).msapp at master · aprildunnam/PowerApps · GitHub. Will you correct for me your formul ?  i will be gratefull 🙂 

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (2,236)