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 I
Advocate I

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
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

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (25,878)