web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Block Power App bookin...
Power Apps
Answered

Block Power App bookings based on days

(0) ShareShare
ReportReport
Posted on by 25

Hello, I'm searching for ideas or solutions on how to block room bookings on specific days of the week (e.g., Monday to Friday) for certain rooms with custom IDs set in a SharePoint list.

Where should I store the information (days with booking prohibition) (SP list or app on start property + ID of the room)?
Atm. I have a Button based on Days which is only checking the Date and changing status from visible to invisible...

I want to prevent bookings for some rooms on specific days.
I already have one checker in place (if Date 1 and Date 2 equal 0, then allow booking; otherwise, make the booking button invisible).

Example: 
I have a room 1 with ID: 1.
I want to allow to allow bookings for this room only on Friday and Monday, what would be the best sollution to make it? 
All other rooms shoud be bookable at every day. 

Categories:
I have the same question (0)
  • Verified answer
    M_Ali_SZ365 Profile Picture
    1,110 on at

    Hi @JordanSeremy 

    Try This

    You can use LookUp to find the specific room.

     

    // Example of retrieving the selected room availability on button select
    SelectedRoomAvailability := LookUp(RoomAvailability, RoomID = SelectedRoomID, AvailableDays)

     

    You can use the Weekday() function to determine the day of the week for the selected booking date.

     

    // Example of function to check if the booking is allowed
    IsBookingAllowed := If(
     Weekday(SelectedDate) in SelectedRoomAvailability.AvailableDays,
     true, // If the selected day is in the list of available days, booking is allowed
     false // Otherwise, it is not allowed
    )

     

    Use the IsBookingAllowed variable to control the visibility or disabled state of the booking button.

     

    // Set the Visible or DisplayMode property of the booking button
    BookingButton.Visible := IsBookingAllowed
    // or
    BookingButton.DisplayMode := If(IsBookingAllowed, DisplayMode.Edit, DisplayMode.Disabled)

     

    Use the OnStart property to load this data when the app starts.

     

    // Cache the room availability data
    ClearCollect(LocalRoomAvailability, RoomAvailability)

     

    Here is a mock-up of what the button's DisplayMode property formula might look like, assuming you've set up everything as described above:

     

    If(
     Weekday(DatePicker.SelectedDate, StartOfWeek.Sunday) in LookUp(LocalRoomAvailability, RoomID = DropdownSelectedRoomID).AvailableDays.Value,
     DisplayMode.Edit,
     DisplayMode.Disabled
    )

     

    Please accept this solution if it resolves the issue.
    Best regards,
    Muhammad Ali

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 329 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 179

Last 30 days Overall leaderboard