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 / PowerApps filter field...
Power Apps
Unanswered

PowerApps filter field split

(0) ShareShare
ReportReport
Posted on by 80

I've got 1 field named "Search in all fields" which searches in 5 different fields. It now takes the whole input and searches with like function. An colleague want to put in the following: abc 123. Now it will filter like this: *abc 123* into 1 field, but what the colleague actually wants is the following:

*abc*  in all fields AND *123* in all fields. 

So the value 123 can be a part of the productnumber and the abc can be part of the description, but can be both like "This is a description abcdefg 123456".

I don't know how to do it yet, but was already thinking about something.

This is the search.

 

Search(
 PA_ProductSearch_V2S,
 TextInput1.Text,"crb8d_itemid","crb8d_itemdescription", "crb8d_material", "crb8d_fbr","crb8d_credcode","crb8d_suppliername"
 ) 

 

I think I should create a split(TextInput1.text," ") and do something like a forall on this. Then for all items I should filter the datasource. But the last part is still unknown for me. Anyone got an example?

 

Categories:
I have the same question (0)
  • BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi @JoostCuppes ,

     

    You can refer to ThisRecord.Result in the second argument of the Search function to get the value of the current item of the ForAll loop:

     

    ForAll(
    	Split(TextInput1.Text," "),
    	Search(
    				PA_ProductSearch_V2S,
    				ThisRecord.Result,"crb8d_itemid","crb8d_itemdescription", "crb8d_material", "crb8d_fbr","crb8d_credcode","crb8d_suppliername"
    	)
    )	

     

  • WarrenBelz Profile Picture
    153,026 Most Valuable Professional on at

    Hi @JoostCuppes ,

    Try this - I cannot test presently, but should work with a space between the search words

    Ungroup(
     ForAll(
     Split(
     TextInput1.Text,
     " "
     )
     ),
     Filter(
     PA_ProductSearch_V2S,
     Result in crb8d_itemid ||
     Result in crb8d_itemdescription ||
     Result in crb8d_material ||
     Result in crb8d_fbr ||
     Result in crb8d_credcode }}
     Result in crb8d_suppliername
     ),
     "Value"
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • Joost Cuppes Profile Picture
    80 on at

    Hi @BCBuizer @WarrenBelz both of the filtering don't show the results I was expecting.Actually, they aren't showing a thing at all. For now I've tried the following things:

    /*ForAll(
     Split(TextInput1.Text," "),
     Collect(productsearch, Search(PA_ProductSearch_V2S,ThisRecord.Result, "crb8d_itemid","crb8d_itemdescription", "crb8d_material", "crb8d_fbr","crb8d_credcode","crb8d_suppliername"))
     )*/
     /*ClearCollect(productsearch,Search(
     PA_ProductSearch_V2S,
     TextInput1.Text,"crb8d_itemid","crb8d_itemdescription", "crb8d_material", "crb8d_fbr","crb8d_credcode","crb8d_suppliername"
     )
     )*/
     ClearCollect(productsearch,
     ForAll(
     Split(TextInput1.Text," "),
     Search(
     PA_ProductSearch_V2S,
     ThisRecord.Result,"crb8d_itemid","crb8d_itemdescription", "crb8d_material", "crb8d_fbr","crb8d_credcode","crb8d_suppliername"
     )
     ))
     /*ClearCollect(productsearch,
     Ungroup(
     ForAll(
     Split(TextInput1.Text," "),
     Filter(
     PA_ProductSearch_V2S,
     Result in "crb8d_itemid" ||
     Result in "crb8d_material" ||
     Result in "crb8d_fbr" ||
     Result in "crb8d_credcode" ||
     Result in "crb8d_suppliername"
     )
     ) ,"Value"
     )
     )*/

    I've been testing. The first 2 are showing data. 

    1. Showing data but not filtering the filtered data.

    2. Only filter on whole textbox.

    3. Not showing data, made by @BCBuizer. When placing directly on table, the columns aren't found anymore.

    4. Not showing data, made by @WarrenBelz. When placing directly on table, nothing changes.

  • BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi @JoostCuppes ,

     

    Use UnGroup to get the column values:

     

    ClearCollect(
     productsearch,
     Ungroup(
     ForAll(
     Split(
     TextInput1.Text,
     " "
     ),
     Search(
     PA_ProductSearch_V2S,
     ThisRecord.Result,
     "Title"
     )
     ),
     "Value"
     )
    )
  • Joost Cuppes Profile Picture
    80 on at

    Hi, @BCBuizer it does filter now, but not combined. So now it just filters on 140 and then on loctite. It is not combined.

    Example: 

    In your code it will show the upper to rows, but it should actually be filtered to the last row. Because there is the 410 & the loctite (in same or other field).

    123456789locatitenfdsfds
    123410ofdslfdsmfsfdsfds
    55941069daskmldaksloctite
  • WarrenBelz Profile Picture
    153,026 Most Valuable Professional on at

    @JoostCuppes ,

    Three-way conversations just confuse everyone - I will drop out here, although I am a little surprised what I posted did not work for what you described in your post.

  • BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi @JoostCuppes ,

     

    To combine all of those requirements will increase the complexity of the formula quite a bit. Perhaps it's better to use multiple (text input) controls to search the different columns instead of trying to do all this with a single control.

     

    To demonstrate: the below formula is what I came up with which will work with a maximum of 3 search terms and is non delegable:

     

    With(
    	{SearchTerms: Split(TextInput.Text," ")},
     With(
    		{FirstTerm: Index(SearchTerms,1).Result,
    		SecondTerm: Index(SearchTerms,2).Result,
    		ThirdTerm: Index(SearchTerms,3).Result},
    		Filter(
    			Test,
    			IsBlank(FirstTerm) || FirstTerm in crb8d_itemid || FirstTerm in crb8d_itemdescription || FirstTerm in crb8d_material || FirstTerm in crb8d_fbr || FirstTerm in crb8d_credcode || FirstTerm in crb8d_suppliername,
    			IsBlank(SecondTerm) || SecondTerm in crb8d_itemid || SecondTerm in crb8d_itemdescription || SecondTerm in crb8d_material || SecondTerm in crb8d_fbr || SecondTerm in crb8d_credcode || SecondTerm in crb8d_suppliername,
    			IsBlank(ThirdTerm) || ThirdTerm in crb8d_itemid || ThirdTerm in crb8d_itemdescription || ThirdTerm in crb8d_material || ThirdTerm in crb8d_fbr || ThirdTerm in crb8d_credcode || ThirdTerm in crb8d_suppliername
    		)
    	)
    )
  • Joost Cuppes Profile Picture
    80 on at

    This is the form: 

    JoostCuppes_0-1675860171836.png

    Here you can see we have fields for each separate fields and the All fields searches in a few of them. I thought there would be a better/doable solution for this.
    Simple thing what has to be done:

    - Collect all records

    - for each splitted item of "All fields search bar" create an extra filter on this collection with like function.

    - Show collection.

     

    So if filtering on 123 abc the export will look like this:

    article_123 abc 256

    article_2 abc 123

    article_321 123 abc

     

    The next wont show, because it is not with both splitted search terms. 

    article_321 123 abd

    article_12 342 abc

     

    JoostCuppes_0-1675862280639.png

     

  • BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi @JoostCuppes ,

     

    I understand what your're saying, but the type of looping you need for your approach is not available in Power Apps.

     

    If you already have existing search fields for each column, I would actually suggest to scrap this functionality since the complexity it introduces is not outweighn by the added value.

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard