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

undefined

(0) ShareShare
ReportReport
Posted on by 4

Im building a powerapp and need to filter already booked reservations from my dropdown..i already have unique values in SharePoint list but i need to only show available rooms in my drop down

Categories:
I have the same question (0)
  • Sunil Kumar Pashikanti Profile Picture
    2,137 Moderator on at

    Hi @Jojo17,

     

    For example, A SharePoint list "Reservations" that contains unique values in Title column and its corresponding status values.

    SunilPashikanti_1-1701044217483.png

    Now, in a PowerApps dropdown we need to display the unique values those status are Open (available) rooms only.

    SunilPashikanti_0-1701044202009.png

    If you check the above picture, left side galley shows all the items and the right-side dropdown shows only filtered items whose status is Open (available).

     

    Use the below code to show the filtered data in dropdown:

    Filter(Reservations, Status.Value = "Open").

     

    If I misunderstood the requirement, please let me know, thanks.

     

    @SunilPashikanti 

     

  • Jojo17 Profile Picture
    4 on at

    Hi thanks

     

    So i have two SharePoint listed

     

    One with all seats and two with the input from app which captures.seat.person and date is default today

     

    So when a person books from the dropdown which are lookup field on the desk they should only see available desks.

     

    So basically all desks filtered by reserved desks only for today should give me available desks for today to book

  • Jojo17 Profile Picture
    4 on at

    Hi Sunil,

    I tried it but it doesn't work.

    Not that my unique values are coming from a lookup field in SharePoint list

    So the logic is in the input sheet I have a lookup to all desks

    Then anything on the input sheet for today should not show on the dropdown,only available to select

    Which is all desks not equal to reserved desks then becomes available

    I just can't get this context to work

    Maybe you have an alternate suggestion how I can achieve this functionality?

  • Sunil Kumar Pashikanti Profile Picture
    2,137 Moderator on at

    Hi @Jojo17,

     

    Imagine seats as Rooms.

     

    SharePoint list 1: Rooms is a master list which contains all the rooms.

    SharePoint list 2: My Room Reservations, a transaction list which contains fields like [Person, Rooms (lookup field from Rooms list), Date (today)].

     

    Business Scenario:

    Every day users will reserve a room for the current day. If a room is reserved for a user for the current day, that room should not be available in the Rooms dropdown (should not be available for other users for booking on that particular day). This scenario repeats every day. 

     

    If you are expecting a solution for this problem, then please use the below procedure, else let me know more details with your SharePoint lists schema and some sample data.

     

    Booked Rooms for todayAvailable Rooms for today 
    SunilPashikanti_1-1701237920925.png

     

    SunilPashikanti_0-1701237779532.png

     

     

    Use the below code in the Screen (Page) - OnVisible property.

     

     

    //Collect all available rooms
    ClearCollect(collAllReservations, Choices(MyRoomReservations.Rooms));
    
    //Clear the reserved rooms
    Clear(collAvailableRooms);
    
    //Loop through the datasource(collection) named 'collAllReservations',
    //name each row as 'Room' and check if that room is reserved for today
    ForAll(
     collAllReservations As Room,
     If(IsEmpty(Filter(MyRoomReservations, Date = Today(), Rooms.Value = Room.Value)),
     Collect(collAvailableRooms, Room)
     )
    );

     

     

    Assign the "collAvailableRooms" collection to Items property of Rooms combobox.

     

    Thanks,

    @SunilPashikanti 

     

     

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 463

#2
WarrenBelz Profile Picture

WarrenBelz 364 Most Valuable Professional

#3
11manish Profile Picture

11manish 275

Last 30 days Overall leaderboard