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 / multiple search words ...
Power Apps
Unanswered

multiple search words search in a gallery

(0) ShareShare
ReportReport
Posted on by 69

I have a textbox (TextInputFilterEvents) that I want to populate with search words:

"tra provinciale voorronde 1"
with the onchange event of the textbox, I populate a collection with these separate words:

ClearCollect(
ColSearchWords,
Split(TextInputFilterEvents.Text, " ")
);

ClearCollect(
ColFilteredClubInfo,
ForAll(
ColSearchWords As SEARCHWORD,
Filter(
VarEvents,
SEARCHWORD.Value in title
)
))

Then I have a gallery (VarEvents) that contains the field title, and I want to filter that gallery on the filter that contains all the keywords from the textbox. The words can be in a random order in the "title" field.

Filter(
VarEvents,
Sum(
ForAll(
Filter(Split(TextInputFilterEvents.Text, " "), Len(Trim(Result)) > 0),
If(Result in title, 1, 0)),
Value) > 0);

This code does not work, it returns results that contain only 1 of the words, I want all words to be in the title field.

Any suggestions?

Categories:
I have the same question (0)
  • anandm08 Profile Picture
    1,936 Super User 2024 Season 2 on at

    hi @Kurry ,

    To ensure that all words from the TextInputFilterEvents text box must be present in the title field of your VarEvents gallery, you can adjust your PowerApps code. The goal is to create a filter that checks for the presence of each word from the search text in the title field and ensures that all of them are found.

    Splitting the Search Text into Words

    This step is correct in your approach:

     

    ClearCollect(
     ColSearchWords,
     Split(TextInputFilterEvents.Text, " ")
    );

     

     

    Filtering the Gallery

    To filter the VarEvents such that all search words must be in the title, you can use a combination of ForAll and And to ensure that each word is present.

    Here’s the modified code for the filter:

     

    ClearCollect(
     ColFilteredClubInfo,
     Filter(
     VarEvents,
     And(
     ForAll(
     ColSearchWords As SEARCHWORD,
     SEARCHWORD.Value in title
     )
     )
     )
    );

     

  • Kurry Profile Picture
    69 on at

    Your code looks good, but I think he does not like the array in the loop.

    Invalid argument type (Table). Expecting a Boolean value instead.

     

    Kurry_0-1718803316519.png

    Thx for helping me out!

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

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 335 Most Valuable Professional

#2
11manish Profile Picture

11manish 166

#3
sannavajjala87 Profile Picture

sannavajjala87 71 Super User 2026 Season 1

Last 30 days Overall leaderboard