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 / Book a Room App - Filt...
Power Apps
Answered

Book a Room App - Filter rooms with a Dropdown box

(0) ShareShare
ReportReport
Posted on by 94

Hi, I am modifying the Book a Room app. I have successfully added a search box (called tbSearchInput) on the 'RoomSelectScreen' so that you can filter the the rooms displayed (within 'RoomsGallery') when you are booking a room. Using this code: Filter(AvailableRoomEmailName,tbSearchInput.Text in Email)

 

But I'd also like to add a dropdown box that uses the Department that rooms are in. I have assigned rooms to different departments in the Office Exchange settings. In my testing so far I can add a Dropdown that can filter by email using this code: 

Filter(AvailableRoomEmailName,Dropdown1.Selected.Value in Email) But if I change this to Department it doesn't work. 

 

It's as if it's not collecting a rooms department, only it's name and email. I can see the code (see below) on the 'OnVisible' property of the 'RoomSelectScreen' mentions email and name so I'm thinking this is where I need to tell it to collect the Department as well but everything I have tried has failed. 

 

Any help would be much appreciated. Many thanks, Rob

 

'OnVisible' code of 'RoomSelectScreen'

Set(CalendarFromSelectMeeting, false);
If(DateTimeRoomChange,
Set(AvailableRoomsCounter, 1);
UpdateContext({ShowLoading: true});
Set(RoomsLeft, Blank());
Set(DateTimeRoomChange, false);
If(!NoRoomsList,
ClearCollect(AllRooms, Office365.GetRoomsInRoomList(RoomsListsGallery.Selected.Address).value)
);
If(CountRows(AllRooms) > 20,
Set(AllRoomsConnector, Concat(FirstN(AllRooms, 20), Address & ";")),
Set(AllRoomsConnector, Concat(AllRooms, Address & ";"))
);

ClearCollect(AvailableRooms, Office365.FindMeetingTimes({RequiredAttendees: AllRoomsConnector, IsOrganizerOptional: true,
Start: StartDateTimeUTC, End: EndDateTimeUTC, MeetingDuration: DateDiff(StartDateTime, EndDateTime, Minutes),
MinimumAttendeePercentage: "1", ActivityDomain: "Unrestricted"}));

ClearCollect(AvailableRoomsSorted, SortByColumns(First(AvailableRooms).MeetingTimeSuggestions, "Confidence", Descending));

ClearCollect(AvailableRoomsConcat, Concat(Filter(First(AvailableRoomsSorted).AttendeeAvailability, Availability = "Free"),
Attendee.EmailAddress.Address, ","));

ClearCollect(AvailableRoomEmails, Split(First(AvailableRoomsConcat).Value, ","));

ClearCollect(AvailableRoomEmailName, AddColumns(RenameColumns(AvailableRoomEmails, "Result", "Email"), "Name",
LookUp(AllRooms, Email = Address).Name));

UpdateContext({ShowLoading: false});
Set(RoomsLeft, CountRows(AllRooms) - 20 * AvailableRoomsCounter)
)

 

 

Categories:
  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @RobChilds ,

     

    Would you like to retrieve and filter by departments that rooms assigned to? 

     

    If so, I'm afraid there is no way to achieve your goal since I have not found any connectors could get departments of rooms. I found that only New Exchange Admin Center supports setting up room's department.

     

    As a workaround, you may consider setting the room names and department names together as the new room names to achieve the goal. After setting Items of the Department Dropdown to department strings, such as:

    ["Department1","Department2","Department3",...]

    the formula would be:

    Filter(AvailableRoomEmailName,DeptDropdown.Selected.Value in Name)

     

    Hope this helps.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

     

  • RobChilds Profile Picture
    94 on at

    Thanks @v-jefferni for your response.

     

    Thats a shame you can't connect, I was hoping it was possible as I managed to get the Department information of a room using this code and having a text box (called 'InfoAbout') in which you type in the rooms email address fyi:

    Office365Users.UserProfile(InfoAbout.Text).Department

     

    But as you say a good workaround is to name the rooms appropriately, so searching via Name gives the same results.

     

    My next question would be how do I incorporate the search box as well?

     

    So I need to merge these two codes and apply them to the 'RoomsGallery'...

    Filter(AvailableRoomEmailName,tbSearchInput.Text in Name)

    AND

    Filter(AvailableRoomEmailName,Dropdown1.Selected.Value in Name)

     

    Many thanks for your help.

    Rob

  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @RobChilds ,

     

    You could leverage the Search function to achieve that easily:

    Search(Filter(AvailableRoomEmailName,tbSearchInput.Text in Name),Dropdown1.Selected.Value,"Name")

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

  • RobChilds Profile Picture
    94 on at

    That works perfectly. Thanks very much for all your help!

     

    One last question if I may...

     

    How do I add an "All" option in the Dropdown box? If I use "" that does work but obviously it just shows as a blank option in the Dropdown box. It would be a lot nicer if it says "All" instead.

     

    Thanks kindly,

    Rob

  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @RobChilds ,

     

    You could try and set Items of the Dropdown into the syntax of:

    Table({Name:"ALL",Value:""},{Name:"Department1",Value:"Department1"},{Name:"Department2",Value:"Department2"},{Name:"Department3",Value:"Department3"})

    then set Value of the Dropdown to "Name" column:

    264.png

     

    It just add a "Name" column with display values for users to select in the Dropdown, the actual selected value is "" when "ALL" is selected.

     

    Hope this helps.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

  • RobChilds Profile Picture
    94 on at

    That works perfectly! Thanks again for all your help, very much appreciated.

     

    Best regards,

    Rob

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 354 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 320

#3
Mohsin Ali Profile Picture

Mohsin Ali 246

Last 30 days Overall leaderboard