cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Search in multiple columns with search box

I have a gallery connected to a SharePoint list. I have add a search box to this gallery. Currently the search box works but it only searches on the Title field. I also want to search in another column named Achternaam (Last name). The results will be soredt by achternaam, ascending. How do i edit the formula so it also searches the Achternaam column?

 

The formula i now use is: SortByColumns(Filter(CachedLunchlijst, StartsWith(Title, Zoeken.Text)),"Achternaam",Ascending)

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

There was a similar question asked: https://powerusers.microsoft.com/t5/General-Discussion/Searching-on-multiple-fields-or-columns/td-p/...

 

In your instance, I would try: Sort(Search('CachedLunchlijst', Zoeken.Text, "Title", "Achternaam"), "Achternaam", Ascending)

 

The only downside to this solution that is it requires all the fields that you want to search to be in a text format previous to using the formula. If you try to convert it using .Value or Text(variable) or Value(text) or any other way in the formula, then errors will occur. Hope this helps.

View solution in original post

2 REPLIES 2
tianaranjo
Continued Contributor
Continued Contributor

@Anonymous

You might try:

SortByColumns(
      Filter(
            CachedLunchlijst,

                  StartsWith(
                        Title, Zoeken.Text ||
                         Achternaam = Zoeken.Text)),
"Achternaam",Ascending)

Anonymous
Not applicable

There was a similar question asked: https://powerusers.microsoft.com/t5/General-Discussion/Searching-on-multiple-fields-or-columns/td-p/...

 

In your instance, I would try: Sort(Search('CachedLunchlijst', Zoeken.Text, "Title", "Achternaam"), "Achternaam", Ascending)

 

The only downside to this solution that is it requires all the fields that you want to search to be in a text format previous to using the formula. If you try to convert it using .Value or Text(variable) or Value(text) or any other way in the formula, then errors will occur. Hope this helps.

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (2,452)