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 Apps
Answered

Filter and search

(0) ShareShare
ReportReport
Posted on by 24

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.

 

Categories:
I have the same question (0)
  • Verified answer
    RezaDorrani Profile Picture
    12,145 on at

    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

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

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard