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 / Problem with searching...
Power Apps
Answered

Problem with searching a filtered gallery

(0) ShareShare
ReportReport
Posted on by 18

I have 2 screens in my PowerApp, the 1st is a gallery of my dept database, the 2nd is a gallery of the devices within that department, which is filtered by the selection of the first gallery.

 

I am having trouble filtering that gallery via a txtbox search to find a specific device.  I am using an if statement to split so that it will show all devices in that department if the search is left blank.  Filtering while the text box is blank works without issue.

 

This is the code for the 2nd gallery that I have so far.

 

 

With(
 {item: 'EUD Device DB'},
 If(
 !IsBlank(txtbox_DevSearch.Text),
 Filter(
 'EUD Device DB',
 Text(DeptBrowseGallery.Selected.'Site ID') = 'Site ID'.Value

		<code here>

 ), 
 IsBlank(txtbox_DevSearch.Text),
 Filter('EUD Device DB',
 Text(DeptBrowseGallery.Selected.'Site ID') = 'Site ID'.Value )
 )
)

 

 

Obviously I am trying to fill in the <code here> part with a working solution to my problem.  The text input is called 'txtbox_DevSearch', and the columns I need it to search are 'Map ID', and 'Device Name (PC Name)' 

 

My original design looked like this and this does not work at all. 

 

Filter(
 'EUD Device DB',
 Text(DeptBrowseGallery.Selected.'Site ID') = 'Site ID'.Value 
) && Filter(
 'EUD Device DB',
 txtbox_DevSearch.Text) StartsWith(
 'Map ID',
 txtbox_DevSearch.Text
 ) || StartsWith(
 'Device Name (PC Name)',
 txtbox_DevSearch.Text
 ))

 

 

Any help with this would be greatly appreciated.

Categories:
I have the same question (0)
  • Verified answer
    KyleACampbell Profile Picture
    18 on at

    Nevermind I was able to figure it out finally, it was a syntax issue.  I wans't using nearly enough parentheses lol.

     

    Solution for anyone who finds their way here in the future 

    With(
     {item: 'EUD Device DB'},
     If(
     !IsBlank(txtbox_DevSearch.Text),
     Filter(
     'EUD Device DB',
     (Text(DeptBrowseGallery.Selected.'Site ID') = 'Site ID'.Value) && (StartsWith(
     'Map ID',
     txtbox_DevSearch.Text
     )) || (StartsWith(
     'Device Name (PC Name)',
     txtbox_DevSearch.Text
     ))
     ),
     IsBlank(txtbox_DevSearch.Text),
     Filter(
     'EUD Device DB',
     Text(DeptBrowseGallery.Selected.'Site ID') = 'Site ID'.Value
     )
     )
    )

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,055

#2
Valantis Profile Picture

Valantis 666

#2
11manish Profile Picture

11manish 666

Last 30 days Overall leaderboard