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 Apps
Unanswered

Drop down values

(0) ShareShare
ReportReport
Posted on by 20

I have power apps gym slot booking system that checks for duplicates before saving data into a SharePoint list.

 

I have a SharePoint list called Slots that contains 10 slots (entries) to choose from when booking a gym spot. So I'm loading slots into a dropdown.

But now I want to load the slots into a dropdown list based on the selected date on the datepicker.

 

We need to check another SharePoint list called Reservations to see which slots are free from the 10 based on the selected date on a datepicker. We use this list to store the booked slots, so it will tell us what slots are booked and which ones are free based on the selected date.

 

The datepicker column name is 'ReservationDate'.

 

Can someone please assist me.

 

Categories:
  • v-mengmli-msft Profile Picture
    Microsoft Employee on at

    Hi @StanSaggi ,

     

    Here is a method for your reference:

    Assuming that there is a lookup column about slots in Reservations, please try this:

    Items of drop down:

     

    Filter(Choices([@Reservations].LookUpColumn),Not(Value in Filter(AddColumns(Reservations,"test",LookUpColumn.Value),DateColumn=ReservationDate.SelectedDate,test)))

     

     

    Best regards,

    Rimmon

  • StanSaggi Profile Picture
    20 on at

    Hi Rimmon, I'm a bit confused by the code. Could you please help clear it up for me.

    This is how everything is designed.

    I want to load SharePoint list values into a drop down based on the datepicker value.

    It is a gym booking system, that allows only 10 people to book per day.

     

    This is the SharePoint list called 'Slots', this is how it looks like. The name of this column is 'Title'

     

     

    StanSaggi_0-1708586831450.png

     

     

     

     

    I have another SharePoint list called 'Reservations', this is a list that I use to capture all the slots. This is how it looks like:

     

    StanSaggi_1-1708586831666.png

     

     

     

     

    Now I'm doing a check before I save a booking, I check if the selected slot is free.

    This is how my screen looks like

     

    StanSaggi_2-1708586831673.png

     

     

     

    This is the code I use to check before saving the slot in the Reservations list. This is also to stop duplicates.

     

    If(
        !IsBlank(
            LookUp(
                Reservations,
                'Desk ID' = DrpDwnFloorDeskNum.Selected.Title && ReservationDate  = Text(BookingDateDatePicker.SelectedDate, "dd/mm/yyyy", "en-GB")
            )
        ),
        Notify(
            "There is already a booking on the selected slot",
            NotificationType.Error
        ),
        Patch(
        Reservations,
        Defaults(Reservations),
        {
            'Desk ID': DrpDwnFloorDeskNum.Selected.Title,
            ReservationDate: Text(BookingDateDatePicker.SelectedDate, "dd/mm/yyyy", "en-GB"),
            StartTime: DrpDwnStartTime.Selected.Value,
            EndTime: DrpDwnEndTime.Selected.Value
        }
        );
        Navigate(Confirmation);
        Reset(BookingDateDatePicker);
        Reset(DrpDwnEndTime);
        Reset(DrpDwnFloorDeskNum);
        Reset(DrpDwnStartTime);
        Reset(Gallery1);

    )
     
    But now I want to load the Slots on the screen based what date is selected and what slots are booked.
    E.g if I select date '01/02/2024' and all the slots are free. Then in the dropdown showing the slots I should display all the slots.
    But if I select date '01/02/2024' and Slot 1 is booked. Then in the dropdown showing the slots I should display Slots 2-10.
    But if I select date '01/02/2024' and Slot 1 and Slot 2 are booked. Then in the dropdown showing the slots I should display Slots 3-10.
     
    So I need to check the Reservations SharePoint list, then filter\display the values of the dropdown showing the slots based on the date and which slots are not appearing in the Reservations list.
    So on and so on.
     
    If all the Slots are booked, then I should tell the user that for that date, there are no available slots.
    I also need to email the person who booked the slot or send them a message on Teams, so that they can have proof of the booking.

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 224 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 189 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 126

Last 30 days Overall leaderboard