cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tofsweden
Helper II
Helper II

How to be able to search more than one value

Hello, I tried looking up https://powerapps.microsoft.com/en-us/tutorials/function-filter-lookup/

For a solution where you are able to search more specific through gallery.

 

For now, my code snippet is pretty standard and look like this:

SortByColumns(
Search(
datasource1; TextSearchBox2.Text; "car"; "FirstName"; "LastName"; "airplanes");
"car"; If(SortDescending1; Descending; Ascending))

The issue is that when I search, I'am only able to search for one value. i.e. John Doe

'John'

it will show like 100 guys named John.

It doesn't work to search like 'John Doe' because if you do, gallery returns empty fields.

 

I tried to look for examples provided in the link further up however syntax doesn't accept || or && in the code I posted above.

Is there any solution?

 

Regards!

 

 

 

2 REPLIES 2
CarlosFigueira
Power Apps
Power Apps

You can try using the AddColumns function to "add" a new column to your data source, and with that you should be able to search on that column as well:

SortByColumns(
    Search(
        AddColumns(datasource1; "FullName"; FirstName & " " & LastName);
        TextSearchBox2.Text;
        "FirstName"; "LastName"; "FullName");
    "car";
    If(SortDescending1; Descending; Ascending))

Notice that it doesn't really modify your data source - your source will still only have columns for the first and last name. But the "table" over which the Search function is working now has a new column that can be searched as well.

Hi @CarlosFigueira

 

Hmm, I tried what you proposed however it didn't work. Could there be something you forgot to tell me? Or maybe special condition?

 

Regards

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

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (30,237)