cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
billyapps
Level: Powered On

Search and filter results in nested gallery

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"))
    )

 

 

Screen Shot 2019-10-23 at 3.56.14 pm.pngGallery 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

1 ACCEPTED SOLUTION

Accepted Solutions
v-siky-msft
Level 10

Re: Search and filter results in nested gallery

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.

 

View solution in original post

2 REPLIES 2
v-siky-msft
Level 10

Re: Search and filter results in nested gallery

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.

 

View solution in original post

billyapps
Level: Powered On

Re: Search and filter results in nested gallery

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!

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 212 members 5,387 guests
Please welcome our newest community members: