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 / 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,707 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 Moderator 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 519 Most Valuable Professional

#2
11manish Profile Picture

11manish 489

#3
Haque Profile Picture

Haque 327

Last 30 days Overall leaderboard