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 / Gallery with button an...
Power Apps
Answered

Gallery with button and text search filter across multiple columns

(0) ShareShare
ReportReport
Posted on by

I have a gallery in which I want the user to be able to search for items based on their values in multiple columns. They can also click on a tab (that sets varCurrentTab to a category of items) in order to filter on their status. Currently it works, but only with one column as a searchable column. How can I modify it so that it searches multiple columns?

 

I think it might be an issue with how the AddColumns limits the span to only include the Gjenstandstype column.  

 

My current gallery filter code looks like this

 

 

Filter(
 Search(
 AddColumns(
 'Teknisk utstyr',
 "GjenstSearch",
 Gjenstandstype.Value
 ),
 inpSearch.Value,
 "GjenstSearch"
 ),
 Status.Value = varCurrentTab
)

 

 

EDIT:

Here is my working code, for anyone interested:

Filter(
 Search(
 AddColumns(
 'Teknisk utstyr',
 "GjenstSearch",
 Gjenstandstype.Value,
 "ModellSearch",
 Modell,
 "PersonSearch",
 'Utlevert til'.DisplayName,
 "IdSearch",
 Title
 ),
 inpSearch.Value,
 "GjenstSearch",
 "ModellSearch",
 "PersonSearch",
 "IdSearch"
 ),
 Status.Value = varCurrentTab
)

 

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

    Hi @ErikKjellman 

     

    Plz try this formula's

     Filter(
    Search(
    AddColumns(
    'Teknisk utstyr',
    "GjenstSearch",
    Gjenstandstype.Value && AnotherColumn.Value && YetAnotherColumn.Value
    ),
    inpSearch.Value,
    "GjenstSearch"
    ),
    Status.Value = varCurrentTab
    )                                                                                 

    or

     

     Filter(
    Search(
    AddColumns(
    'Teknisk utstyr',
    "GjenstSearch",
    Gjenstandstype.Value || AnotherColumn.Value || YetAnotherColumn.Value
    ),
    inpSearch.Value,
    "GjenstSearch"
    ),
    Status.Value = varCurrentTab
    ) 

    Thanks! 

     

     

     

     

  • Shaheer Ahmad Profile Picture
    2,194 Moderator on at

    To enable searching across multiple columns in your gallery, you can concatenate the values of the desired columns into a single string and use that as the searchable column. Here's an updated version of your gallery filter code:

     

     

    Filter(
     Search(
     AddColumns(
     'Teknisk utstyr',
     "SearchableColumns",
     Concatenate(Gjenstandstype.Value, " ", Column2.Value, " ", Column3.Value) // Add all the columns you want to search
     ),
     inpSearch.Text,
     "SearchableColumns"
     ),
     Status.Value = varCurrentTab
    )

     

     

    In the example above, Column2 and Column3 represent the additional columns you want to include in the search. Modify the code by replacing Column2 and Column3 with the actual column names you want to search. The Concatenate function combines the values of the specified columns, separated by spaces, into a single string column called "SearchableColumns".

    The Search function then searches for the inpSearch.Text value within the "SearchableColumns" column. By specifying this column as the third parameter of the Search function, you ensure that the search operation is performed across all the concatenated values.

    Lastly, the "Filter" function is used to filter the results based on the "Status.Value = varCurrentTab" condition, as you mentioned in your question.

    Remember to adjust the column names and input control names according to your specific app requirements.

  • WarrenBelz Profile Picture
    155,284 Most Valuable Professional on at

    HI @ErikKjellman ,

    Assuming the additional columns are text (insert your column names)

    Filter(
     Search(
     AddColumns(
     'Teknisk utstyr',
     "GjenstSearch",
     Gjenstandstype.Value
     ),
     inpSearch.Value,
     "GjenstSearch",
     "Column2",
     "Column3"
     ),
     Status.Value = varCurrentTab
    )

     

    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

  • CU12090750-0 Profile Picture
    on at

    I could not get any of the suggested solutions to work.

    I will clarify that the two other columns I want to search is the Title column and a Person column. I tried using Title.Value but i get a warning saying

    Invalid use of '.'

     When I remove the .Value it is fine, but the error now is 

    The function 'Search' has some invalid arguments.

     

    It seems that errors occur no matter which type of column I use. I have tested with different types and adding anything after Gjenstandstype.Value brakes the function, when trying @Prabhakar_S solution.

     

    @WarrenBelz your solution does not work either, since your assumption of text was erroneous. Sorry for not being more clear upfront.

     

    @ShaheerAhmad concatenate failed as well, same problem as with the first solution.

  • Verified answer
    WarrenBelz Profile Picture
    155,284 Most Valuable Professional on at

    @ErikKjellman ,

    My suggestion was based on my assumptions as you have not specified the column types for the additional search. If they are Choice columns

    Filter(
     Search(
     AddColumns(
     'Teknisk utstyr',
     "GjenstSearch",
     Gjenstandstype.Value,
     "Search1",
     Column1.Value,
     "Search2",
     Column2.Value
     ),
     inpSearch.Value,
     "GjenstSearch",
     "Search1",
     "Search2"
     ),
     Status.Value = varCurrentTab
    )

    If this is not what you need, please post your  attempted code in Text as well as the column types you are searcing.

     

    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

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,074

#2
Valantis Profile Picture

Valantis 639

#3
11manish Profile Picture

11manish 606

Last 30 days Overall leaderboard