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 / Load drop down based o...
Power Apps
Unanswered

Load drop down based on list

(0) ShareShare
ReportReport
Posted on by 20

Hi everyone, 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_2-1708505957096.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-1708505926827.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_0-1708505871447.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.
 
 

 

Categories:
I have the same question (0)
  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @StanSaggi ,

     

    You can simply filter the Slots lists based on the result of filtering Reservations list on the selected date. Items of the Slots Dropdown control would be:

     

    With(
     {wRD: Filter(Reservations, ReservationDate = DatePicker.SelectedDate)},
     Filter(Slots, Not(Title in wRD.'Desk ID')
    )

     

     

    Best regards, 

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
11manish Profile Picture

11manish 600

#2
WarrenBelz Profile Picture

WarrenBelz 478 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 322

Last 30 days Overall leaderboard