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

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().

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
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (1,825)