cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
andrasetof30
New Member

PowerApps Filter and Search drop down DataTable

Hello,

I am a begginer user, trying to build an PowerApp. I added a DataTable, a textInputSearch and a dropDown1 filter Company.

When dropDown1 Filter Company is Blank, i want to display all Items from my list (NameList).  I want to search based on Title, and if i select a value from dropDown, i want to display that exact item(s) or if i select a value from dropDown1, i want to display all items from that company value.

My Company column is Choice type, but i have another column for company but it is Single line of text.

 

Can someone help me to understand what should i do?

 

I have tried this in DataTable - Items:

 

 

If(IsBlank(Dropdown1.Selected.Value), NameList, SortByColumns(Search(Filter(NameList,Company.Value = Dropdown1.Selected.Value), TextInput1.Text, "Title", , Ascending))

 

 

When i want to search, it doesnt display anything. Only when i select a company value, it will display result based on Search and DropDown.

How should i search and filter in those two cases? (choice and single line of text column)

 

Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
Gochix
Solution Sage
Solution Sage

@andrasetof30 ,

 

Try:

 

If(IsBlank(Dropdown1.Selected.Value), SortByColumns(Search(NameList, TextInput1.Text,"Title"),"Title",Ascending), SortByColumns(Search(Filter(TestingDB,Company = Dropdown1.Selected.Value), TextInput1.Text, "Company"),"Company", Ascending))

 

View solution in original post

4 REPLIES 4
Gochix
Solution Sage
Solution Sage

Hi @andrasetof30 ,

 

You had a mistake in your code.

 

If(IsBlank(Dropdown1.Selected.Value), NameList, SortByColumns(Search(Filter(NameList,Company = Dropdown1.Selected.Value), TextInput1.Text, "Title"),"Title", Ascending))

 

Yes, but if i search something, it is not working. Only if i search and select a value from drop down it is going to work. But i want searching to work when dropDown is Blank().

Pavan_Mani_Deep
Helper I
Helper I

Hi @andrasetof30 ,

 

Try with below.

If(IsBlank(Dropdown1.Selected.Value), NameList, SortByColumns(Search(Filter(NameList,Company.Value = Dropdown1.Selected.Value), TextInput1.Text, "Title"),"Title", Ascending))

 

Please accept this as solution if it helped you, if it had helped you in some way, consider giving a thumbs up...

 

Cheers,

PMDY

Gochix
Solution Sage
Solution Sage

@andrasetof30 ,

 

Try:

 

If(IsBlank(Dropdown1.Selected.Value), SortByColumns(Search(NameList, TextInput1.Text,"Title"),"Title",Ascending), SortByColumns(Search(Filter(TestingDB,Company = Dropdown1.Selected.Value), TextInput1.Text, "Company"),"Company", Ascending))

 

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Solution Authors
Top Kudoed Authors
Users online (3,058)