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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Remove or disable book...
Power Apps
Suggested Answer

Remove or disable booked time slots in time picker

(2) ShareShare
ReportReport
Posted on by 36

Hi All, 


I have a meeting room booking system. I need to grey out or remove time slots that have already been used on a form in Power Apps. Alternatively, is there a way to display an error message for already booked time slots? please help

I have the same question (0)
  • Suggested answer
    KeithAtherton Profile Picture
    3,705 Most Valuable Professional on at
    Hey. If your code controls which items appear in the time picker dropdown controls then you can use logic to only show those times which are available.
     
    Alternatively, as you say, you can display a message to the user by checking if the time slot is free and, if it is not, then display a message to the user using the Notify() function.
  • Suggested answer
    jpespena Profile Picture
    335 on at
    Hi,
     
    You can filtering the Hours dropdown for Start Date & Time using:
    Filter(
        [
            "00",
            "01",
            "02",
            "03",
            "04",
            "05",
            "06",
            "07",
            "08",
            "09",
            "10",
            "11",
            "12",
            "13",
            "14",
            "15",
            "16",
            "17",
            "18",
            "19",
            "20",
            "21",
            "22",
            "23"
        ],
        !(Value in AddColumns(
            DataSource,
            Hours,
            Text(
                Hour(StartDateTime),
                "00"
            )
        ).Hours)
    )
     
    But it makes more sense to display a error message if the time slot is taken since you have to separate field for Hour and Minute because if you hide say 08 since someone already booked 08:00, you can no longer book other time within 08:01 to 08:59 since 08 is no longer visible in the dropdown.

    For a error message, you can add a text label with red color on the bottom of the date picker with Visible property:
     
    !IsBlank(LookUp(
        DataSource, 
        StartDateTime = DatePicker.SelectedDate + 
        Time(
            Value(HourPicker.Selected.Value),
            Value(MinutePicker.Selected.Value),
            0
            )
        )
     
  • WW-25090315-0 Profile Picture
    36 on at
     
    I am new to Power Apps. Could you please explain how to do it?
     
    Thak You
  • WW-25090315-0 Profile Picture
    36 on at
    I wrote this code
     
    // Combine Date and Time for Start and End Date
    Set(
        StartDateTime,
        DateAdd(
            DateAdd(
                DateValue1_2.SelectedDate,
                HourValue1_2.Selected.Value,
                TimeUnit.Hours
            ),
            MinuteValue1_2.Selected.Value,
            TimeUnit.Minutes
        )
    );
    Set(
        EndDateTime,
        DateAdd(
            DateAdd(
                DateValue2_2.SelectedDate,
                HourValue2_2.Selected.Value,
                TimeUnit.Hours
            ),
            MinuteValue2_2.Selected.Value,
            TimeUnit.Minutes
        )
    );
    // Check for overlapping bookings
    If(
        CountRows(
            Filter(
                'MeetingRoomNo311',
                (
                    (StartDateTime < 'End Date & Time' && EndDateTime > 'Start Date & Time')
                )
            )
        ) > 0,
        Notify("This time slot is already booked. Please choose another slot.", NotificationType.Error),
        // Submit form and navigate if no conflict
        SubmitForm(Form2_2); // Replace 'Form2_2' with your form name
        Navigate(ViewBooking, ScreenTransition.Fade) // Replace 'ViewBooking' with the name of your screen
    )
     
    but underline line appear in red 
     
    Please help me to fix this
  • CA1105 Profile Picture
    545 Super User 2025 Season 2 on at
    Can you show the error as well?
  • WW-25090315-0 Profile Picture
    36 on at
     
    This is the error and data not submitting

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard