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 / Filter search with mul...
Power Apps
Unanswered

Filter search with multiple values

(0) ShareShare
ReportReport
Posted on by 1,937 Moderator

Hi,

 

Here my current code for gallery search :

 

SortByColumns(Search(StoresList, SearchBar.Text, "Title","field_Description","field_Location"), "field_Description", If(SortDescending1, Descending, Ascending))

 

 

I am able to search anything from the source. Example:

Gochix_0-1632415739460.png

As you see even if i type in GS4SHO it finds the info taken from source. My question is how to modify this code to be able to search things like : ABSORBER GS4SHO and find this row. I know i used to have search function in excel and all i had to do is place &"*".. not sure how it's done in here..

Categories:
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Gochix 

    It depends on which connector  you are using.  Search() is not a delegatable function in Excel and SharePoint, but it works as you describe in Dataverse and SQL. 

  • Gochix Profile Picture
    1,937 Moderator on at

    My source is a collection that i collect from sharepoint list.

  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @Gochix ,

     

    I did a test for you.

    1\ Add a button control and set its onselect property to:

    ClearCollect(Col,{Value:"ABSORBER SHOCK 50 MM GS4SHO"},{Value:"ABSORBER SHOCK 100 MM GS4SHO"})

     

    2\ Add a textinput control 'TextInput1'

     

    3\ Add a gallery control and set its Items property to:

    Filter(ForAll(Col As A,If(CountRows(Filter(ForAll(Split(TextInput1.Text," ") As B,If(B.Result in A.Value,{Value2:1})),!IsBlank(Value2)))=CountRows(Split(TextInput1.Text," ")),A)),!IsBlank(Value))

     

    4\ The result is as follows:

    vxiaochenmsft_0-1632729181946.png

    vxiaochenmsft_1-1632729192409.png

     

    Best Regards,

    Wearsky

     

     

  • Gochix Profile Picture
    1,937 Moderator on at

    @v-xiaochen-msft ,

    Coming back to this as this didn't work in my case.

    I'm using search on button click, not displaying results while typing.

    Also I'm sorting sharepoint list columns.

     

    ClearCollect(
     SearchList,
     SortByColumns(Search(StoresList, SearchBar.Text , "Title","field_Description","field_Location","field_Mfr_x0020_Part_x0020_Number","field_CAG_x0020_Number"), "field_Description", If(SortDescending1, Descending, Ascending))

     

    Can this be somehow linked together with your formula?

    I've tried but without success.

     

    ClearCollect(Col,{Value:
    SortByColumns(Search(StoresList, TextInput2.Text , "Title","field_Description","field_Location","field_Mfr_x0020_Part_x0020_Number","field_CAG_x0020_Number"), "field_Description", If(SortDescending1, Descending, Ascending))});

     

    But when applying your Filter(Forall function in gallery then it doesn't find Value..

     

  • aec2018 Profile Picture
    Microsoft Employee on at

    I'm wondering if this blogpost shared in one of my questions can help you. It deals with searching multiple values and I was able to use it to apply multiple filters on my data source:

     

    https://www.practicalpowerapps.com/data/filters/

  • Gochix Profile Picture
    1,937 Moderator on at

    Hi @aec2018 ,

     

    Your solution would work, however in my case i would need to have some sort of search with only 1 input text.

    Was searching everywhere but can't see that anyone would find a solution for this problem.

     

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Gochix 

    If your SharePoint list contains more than 2k items, your collection will be limited to the first 2000 items and your search will likewise not find all the items. 

  • Gochix Profile Picture
    1,937 Moderator on at

    @Drrickryp ,

    I have over 6000 items. And search works fine as I'm searching inside collection, not sharepoint list.

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Gochix 

    Collect() and ClearCollect() are not delegatable so check your collection. It will contain only the first 2k items in your list. 

  • Gochix Profile Picture
    1,937 Moderator on at

    @Drrickryp , 

    As you see all my rows are being displayed.

    Gochix_2-1634273435765.png

     

    Gochix_0-1634273326072.png    Gochix_1-1634273343368.png

     

     

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 190 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard