cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
shwetapathak
Frequent Visitor

Multiple Search

Hi

 

is it possible to search on multiple columns in powerapps. 

 

My requirement has 4 fields - Name, Country, City, ID. i need to be able to search with Account Name (mandatory) + one or more of other 3 fields.

 

It is not a single Search field (if I'm searching for 'red' it should not search within all columns in my datasource). I have 4 different search fields.

1 ACCEPTED SOLUTION

Accepted Solutions
v-micsh-msft
Community Support
Community Support

Hi @shwetapathak,

 

Yes, that is possible.

We could take use of nested fitlers to make it.

Formula should be:

 

Search(
Filter(Table,
StartsWith(AccountName,TextInput1.Text)
),
TextInput2.Text,
"Country",
"City",
"ID"
)

Formula above would have Country, City and the ID searched within the TextInput 2. If you would like each of the fields have a Input Box, then the formula would be changed into:

Filter(
Filter(
Filter( Filter(Table, StartsWith(AccountName,TextInput1.Text) ), StartsWith(Country,TextInput2.Text)
),
Startswith(City, TextInput3.Text) ),
Startswith(ID, TextInput4.Text)
)

Formula reference:

Filter, Search, and Lookup functions in PowerApps

Regards,

Michael

 

 

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
SmartMeter
Helper V
Helper V

Hi shwetapathak, 

Did you see Michael's suggestion re multi column searches? here

v-micsh-msft
Community Support
Community Support

Hi @shwetapathak,

 

Yes, that is possible.

We could take use of nested fitlers to make it.

Formula should be:

 

Search(
Filter(Table,
StartsWith(AccountName,TextInput1.Text)
),
TextInput2.Text,
"Country",
"City",
"ID"
)

Formula above would have Country, City and the ID searched within the TextInput 2. If you would like each of the fields have a Input Box, then the formula would be changed into:

Filter(
Filter(
Filter( Filter(Table, StartsWith(AccountName,TextInput1.Text) ), StartsWith(Country,TextInput2.Text)
),
Startswith(City, TextInput3.Text) ),
Startswith(ID, TextInput4.Text)
)

Formula reference:

Filter, Search, and Lookup functions in PowerApps

Regards,

Michael

 

 

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

akmiecik
Advocate II
Advocate II

To StartsWith and search multiple columns

Filter(Datasource, StartsWith( Column1, TextSearchBox.Text ) 

     || StartsWith( Column2, TextSearchBox.Text )   

  )

 

The trick lies in the || seperator

Hi, 

 

This formula makes sense, but being very new to power apps I'm not sure where to plug this formula in. 

 

I've attached an image so you can help. 

 

Cheers 

 

 

@Pnolan 

 

You need to be clicked on your gallery and under "Items" is where you would want to place the code above.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

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