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

Filter and search

I have a gallery which displays the contents of a SP online Document Library ("Documents"). I have a dropdown box ("DropDown1") which allows selection of a department and this dropdown is populated from a Collection ("Departments"). I have a TextSearchBox ("TextSearchBox1").

 

I want to display all items in the gallery until:

  1. A user inputs text into TextSearchBox1 - this should then search the "Name" Column of "Documents"
  2. A user makes a selection from "DropDown1" which will filter against the "Department" column of "Documents"

These two actions need to be independant of each other, that is to say that a search will result in returns regardless of whether or not the dropdown has had a selection made and the filter should return results whether or not the search box has text in it.

 

My current code is as follows:

SortByColumns(Search(Filter('Site Content Templates',Deptartment=Dropdown1.SelectedText.Value),
        TextSearchBox1.Text,
        "{Name}","Department"),"{Name}",If(SortDescending1, Descending, Ascending))

 

There are two issues with this:

  1. It doesn't show all items as default
  2. as a result of point 1, the search function only works if the dropdown has a selection.

I'm fairly new at all of this and really need some assistance to make this work. 

 

Thansk very much for your assistance.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Filter and search

Hi @JustinR 

 

Looks like you need to do a check to ensure the dropdown is not blank

you can also include an All option in your dropdown control

 

check this video for more details

https://www.youtube.com/watch?v=pn50AKn3Q1Y

 

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

1 REPLY 1
Super User
Super User

Re: Filter and search

Hi @JustinR 

 

Looks like you need to do a check to ensure the dropdown is not blank

you can also include an All option in your dropdown control

 

check this video for more details

https://www.youtube.com/watch?v=pn50AKn3Q1Y

 

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 359 members 4,923 guests
Please welcome our newest community members: