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 / 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
    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

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 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard