cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kriggo15
Responsive Resident
Responsive Resident

Searching on multiple columns in gallery

Preface: I'm pretty new to PowerApps. I have a gallery that is linked to a SharePoint List. I want to be able to search across all fields with one search box. I can get it working when searching for 1 field but when I try to modify it to search across multiple fields, it breaks.

 

Details:

SP Online List Name: Data Stewards

Fields: Area, Steward Name, Type of Steward

 

Working function when searching across 1 field: SortByColumns(Filter([@'Data Stewards'], StartsWith(Title, TextSearchBox1.Text)), "Title", If(SortDescending1, Descending, Ascending))

 

What modifications need to be made to the above function to be able to use 1 search box and search across all 3 fields?

 

16 REPLIES 16

I appreciate everyone's feedback/suggestions. I got it working withe name field but when I try with Type or Business Area, it says that the type is unsupported for evaluation. All 3 of these fields are single lines of text in the SharePoint list.

 

Update - Just got this working. Apparently I was choosing the wrong field.

kendallsmith
Regular Visitor

Hi, I am unsure of how to combine two search functions together. For instance, I have 

 

Search('PC',txtRF.Text, "and the column name")

and then 

Search('PC',txtPF.Text, "and the column name")

 

They both work individually but, I am unsure how to combine both of them.

Thank you!

@kendallsmith 

 

Search('Source', TextSearchBox1.Text, "Column1", "Column2", "Column3")

how would I go about with two different text boxes with two different columns? So I want a search for RF which is one filter and then another text box for PF so it is another filter box. I don't want to combine them into the same box.

notj
Post Prodigy
Post Prodigy

@kendallsmith I haven't nested searches, but I know you can nest Filters. Here's an example:

Solved: Multiple Search - Power Platform Community (microsoft.com)

Worked perfectly for me! Thanks!

heres2u
Frequent Visitor

I'd simply add "OR" with more "StartsWith" columns, noting that if the columns have multiple words and spaces to use apostrophes (see 3rd example column):

SortByColumns(Filter([@'Data Stewards'],
StartsWith(Area, TextSearchBox1.Text)
Or StartsWith('Steward Name', TextSearchBox1.Text)

Or StartsWith('Type of Steward', TextSearchBox1.Text)
), "Title", If(SortDescending1, Descending, Ascending))

Note:   I left "Title" as the SortDescending1, Descending, Ascending, but that could be changed to a different column.

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (2,599)