web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Search and Filter the ...
Power Apps
Unanswered

Search and Filter the records together in a records gallery

(0) ShareShare
ReportReport
Posted on by 12

hello, I have built an app that is pulling in records from a SharePoint list. I have the search functionality working just fine but I want to be able to add the ability to filter the records that are displayed in the records gallery based off of drop-down selections as well. All of my columns are text columns, not sure if that helps... 

Here is the formula I have for the search: 

Search([@'Enhancement Tracker'], SearchInput1.Text, "ChangeItem_x0028_CI_x0029_", "Description", "Status", "Priority", "Tool")

How can I add a filter for drop-down selections? 
here's how my drop-down currently looks if that helps

zm91_2-1697554050417.png

 

zm91_0-1697553893595.png 

 

 

I tried to see if I could solve my issue by viewing other similar topics on here but none worked for me. I am new to PowerApps so any help is appreciated! Thank you!

 

Categories:
I have the same question (0)
  • NPPlatform Profile Picture
    606 Moderator on at

    If I understand correctly, the code you gave is the code for the items in your gallery, right? You would have to wrap this in a Filter()-function. Am I correct in assuming your combobox contains the possible values for "Priority"? If so, this would result in something like:

     

    Filter(Search([@'Enhancement Tracker'], SearchInput1.Text, "ChangeItem_x0028_CI_x0029_", "Description", "Status", "Priority", "Tool"), 'Priority' in ComboBox1.SelectedItems)

     

    Note that I didn't change anything from your code. It's the same as the part in my code that is in italics. Let me know if this works!

  • zm91 Profile Picture
    12 on at

    hi there! 
    thank you so much for your reply.  Yes, the values in the combobox are values for "Priority". The code you gave me certainly works if I choose a filter from the dropdown but when I don't have any filters selected it won't show any records in my gallery.  How can I get the records to show in the gallery if I don't have a filter selected?

    please see below screenshot

    zm91_1-1697557087199.png

     

     

  • NPPlatform Profile Picture
    606 Moderator on at

    @zm91 Ah yeah, forgot about that. I'm on my phone at the moment so can't write very easily but you could fix this with an if-statement. Something like

     

    If(IsBlank(ComboBox1.SelectedItems), [your original code], [My suggested code]. 

     

    That formula checks whether anything is selected, if not it returns everything. 

  • LaurensM Profile Picture
    12,516 Moderator on at

    @zm91,

     

    @NPPlatform using a condition will certainly work. If I may make one small adjustment - I would try to avoid wrapping If() statements around your queries whenever possible. Often times you can avoid this by adjusting the Filter condition slightly:

     

    Filter(
     Search(
     [@'Enhancement Tracker'], 
     SearchInput1.Text, 
     "ChangeItem_x0028_CI_x0029_", 
     "Description", 
     "Status", 
     // UI/UX wise you may want to limit priority filtering based on either the dropdown or the search input
     "Priority", 
     "Tool"
     ), 
     //Only filter Priority when items are selected
     IsBlank(ComboBox1.SelectedItems) || IsEmpty(ComboBox1.SelectedItems) || 'Priority' in ComboBox1.SelectedItems
    )

     

    I hope this helps!

  • zm91 Profile Picture
    12 on at

    @NPPlatform ,

    @LaurensM 

     

    Thank you to you both! This has been very helpful. I agree that I should probably take out the search function by priority and with that thought I think I can take out ability to search by "Tool" and "Status" as well since those two categories have limited options as well. Any idea how I can add that into the code?

     

    I tried the following but it didn't work, sorry if I made a very silly beginner mistake:

    Filter(Search([@'Enhancement Tracker'], SearchInput1.Text, "ChangeItem_x0028_CI_x0029_", "Description", "Status", "Priority", "Tool"),  IsBlank(ComboBox1.SelectedItems) || IsEmpty(ComboBox1.SelectedItems) || 'Priority', ‘Tool’ in ComboBox1.SelectedItems)

  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    @zm91,

     

    Glad we were able to help! When using multiple columns I would probably expect multiple comboboxes (one for each status type):

    Filter(
     Search(
     [@'Enhancement Tracker'], 
     SearchInput1.Text, 
     "ChangeItem_x0028_CI_x0029_", 
     "Description"
     ), 
     //Pay attention to the different combobox names
     IsBlank(ComboBox1.SelectedItems) || IsEmpty(ComboBox1.SelectedItems) || 'Priority' in ComboBox1.SelectedItems,
     IsBlank(ComboBox2.SelectedItems) || IsEmpty(ComboBox2.SelectedItems) || 'Tool' in ComboBox2.SelectedItems,
     IsBlank(ComboBox3.SelectedItems) || IsEmpty(ComboBox3.SelectedItems) || 'Status' in ComboBox3.SelectedItems
    )

     

    Should you want to use 1 combobox - that is possible but generally I would not recommend this approach:

    Filter(
     Search(
     [@'Enhancement Tracker'], 
     SearchInput1.Text, 
     "ChangeItem_x0028_CI_x0029_", 
     "Description"
     ), 
     //Pay attention to the different combobox names
     IsBlank(ComboBox1.SelectedItems) || IsEmpty(ComboBox1.SelectedItems) || ('Priority' in ComboBox1.SelectedItems || 'Tool' in ComboBox1.SelectedItems || 'Status' in ComboBox1.SelectedItems),
    )

     

    I hope this helps!

  • zm91 Profile Picture
    12 on at

    @LaurensM 

    I tried the multiple combo boxes and it now works perfectly! thank you SO much!

  • NPPlatform Profile Picture
    606 Moderator on at

    Thanks for the improved solution! Made me learn something as well. 

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard