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 / Search and filter resu...
Power Apps
Answered

Search and filter results in nested gallery

(0) ShareShare
ReportReport
Posted on by 10

I have a nested gallery (screenshot attached).

 

Each of the columns has a title, and are filtering results to fit in that column. 

I want to add a search bar that will search results, whilst still staying filtered under the column headings. 

 

e.g. If I search "test", I want all the cards with "test" written on the fields listed below, to show up, but stay in the columns. 

So the results might be - "Testing card for investigate" in the investigate column, and nothing will show in the received column. 

 

My attempted code is below (for only one column so far). Currently, after playing around for a long time, I've only got it to filter by the column, then when a search happens it puts all of the results in that column, and the other columns are filtered by the 'Phase' field. 

 

If(IsBlank(SearchCards.Text),
 If(ThisItem.Value=1,
 Filter(TABLE_MASTER_DATABASE_1,'$ Phase'="Received")),
 
 If(ThisItem.Value=1,
 Search(TABLE_MASTER_DATABASE_1,SearchCards.Text,"$ Board","$ ID","$ Matter Title","$ Matter Description"),
 Filter(TABLE_MASTER_DATABASE_1,'$ Phase'="Received"))
 )

 

 

Gallery with search function at top, needs to search but keep filtered under column.Gallery with search function at top, needs to search but keep filtered under column. 

 

I have also added filters, but am not sure how they would then fit into the same code... 

 

If(IsBlank(SearchCards.Text), 
If(ThisItem.Value=1,
Filter(TABLE_MASTER_DATABASE_1,'$ Phase'="Received")),

If(ThisItem.Value=1,
Search(TABLE_MASTER_DATABASE_1,SearchCards.Text,"$ Board","$ ID","$ Matter Title","$ Matter Description"),
Filter(TABLE_MASTER_DATABASE_1,'$ Phase'="Received"))
)
||

Filter(TABLE_MASTER_DATABASE_1, Priority = PriorityDropDown.Selected.Result)

 

Screenshot of filters: 

Screen Shot 2019-10-23 at 5.11.19 pm.png

Categories:
I have the same question (0)
  • Verified answer
    v-siky-msft Profile Picture
    Microsoft Employee on at

    Hi @billyapps

     

    To better understanding your issue:

    1. Do you want to know how to apply the function of these three filters to the formula?

    2. Do these filters, like the search box, filter the entire data source?

    3. The data filtered by the search box and three filters is still displayed in each column filtered by the title name of each column, right?

     

    Some thoughts: 

    First, I think there is no need to judge if the searchbox is empty, because if it is empty, all records are returned.

    Second, maybe you can set the main gallery items to ["Received", "Investigate","Respond","Submitted"], so that the text of column headings can be ThisItem.Value. More important, we can use '$ Phase'=ThisItem.Value, then the filter will be applied to each column(sub-gallery).

    Third, you can apply the searchbox's search funtion and three filters' Filter funtions together like below( just take PriorityDropDown), it will return a table that meet your search and filter condition

    Filter(Search(TABLE_MASTER_DATABASE_1,SearchCards.Text,"$ Board","$ ID","$ Matter Title","$ Matter Description"),If(IsBlank(PriorityDropDown.Selected),true, Priority = PriorityDropDown.Selected.Result))

    If you want three filters, please refer to the following , just replace <Matter Type Filter> and <Regulator Filter> .

    Filter(Search(TABLE_MASTER_DATABASE_1,SearchCards.Text,"$ Board","$ ID","$ Matter Title","$ Matter Description"),If(IsBlank(PriorityDropDown.Selected),true, Priority = PriorityDropDown.Selected.Result)&& <Matter Type Filter> && <Regulator Filter>)

    Finally, take the table above as the data source, and apply it to column headings filter, then put the following formula to Items property of sub-gallery.

    Filter(Filter(Search(TABLE_MASTER_DATABASE_1,SearchCards.Text,"$ Board","$ ID","$ Matter Title","$ Matter Description"),If(IsBlank(PriorityDropDown.Selected),true, Priority = PriorityDropDown.Selected.Result)),ThisItem.Value in 'Account Name')

    Annotation 2019-10-24 114140.png

    Hope this can help.

    Best regard,

    Sik

    If this post helps, then please click on “Accept as Solution”  to help the other members find it more quickly.

     

  • billyapps Profile Picture
    10 on at

    Thanks Sik! 

    A combination of all of your suggestions worked.

     

    I'm now able to search and filter at the same time, in different combinations, in the gallery (with much simpler code than I was trying). All 3 filters work in conjunction, and the search works with that. 

     

    Thank you so much! 

     

    ... and to answer your questions: 

    1. Do you want to know how to apply the function of these three filters to the formula? Yes

    2. Do these filters, like the search box, filter the entire data source? Yes

    3. The data filtered by the search box and three filters is still displayed in each column filtered by the title name of each column, right? Correct!

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 325 Most Valuable Professional

#2
11manish Profile Picture

11manish 165

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 88 Super User 2026 Season 1

Last 30 days Overall leaderboard