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.

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (50,620)