cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
misc
Resolver II
Resolver II

Filter and Search gallery by a dropdown and limiting the view by the user

I have a gallery where the Items function is currently filtered by the current user's email address being in hidden columns, the formula is:

Sort(Filter('LAB01', 'Creator Email'=varUserEmail||varUserEmail in Split(SharedWith,"; ")),Building,Ascending)

This means that only records which they created by or are shared with the current user will show up.

 

I would like to add in a dropdown or text input search bar so the user can select by building and/or room name/number, as the list is a couple of hundred records long in total and a search would be really useful.

 

I cannot seem to find a way to combine a search feature with the user filter however. Is there a way to combine a 'Searchdpd.Selected.Value = Building' into the above function so it both filters by user AND by the search bar/selection?

 

1 ACCEPTED SOLUTION

Accepted Solutions
CNT
Community Champion
Community Champion

@misc Try this,

Sort(Filter('LAB01', 
	('Creator Email'=varUserEmail||varUserEmail in Split(SharedWith,"; ")) &&
	Building.Value = Searchdpd.Selected.Value
	),Building,Ascending
)

View solution in original post

2 REPLIES 2
CNT
Community Champion
Community Champion

@misc Try this,

Sort(Filter('LAB01', 
	('Creator Email'=varUserEmail||varUserEmail in Split(SharedWith,"; ")) &&
	Building.Value = Searchdpd.Selected.Value
	),Building,Ascending
)

View solution in original post

misc
Resolver II
Resolver II

Thank you, this does work (though I didn't need the .Value). I had tried this before asking with the Building = Search before the Creator email bit, and without brackets so I was nearly there! Good to know I was on the right track and appreciate your help getting me there

 

FWIW, I had kept fiddling with this myself and came up with this solution too:

SortByColumns(If(
    Searchdpd.Selected.Value = "All Buildings", 
    Filter(
	    Search('LAB01', SearchBox.Text, "RoomNumber", "RoomName"),
'Creator Email'=varUserEmail||varUserEmail in Split(SharedWith,"; ")),
        Filter(
	Search('LAB01', SearchBox.Text, "RoomNumber", "RoomName"),
'Creator Email'=varUserEmail||varUserEmail in Split(SharedWith,"; "),
Searchdpd.Selected.Value = Building)), "Building", Ascending)

which allows me to use both a dropdown search for the building and a text input for the room name/number.

 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,636)