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

2 dropdowns and search bar

Hello Community,

I have a problem with filtering on the dataset. It is in sharepoint.

My requirement is to have 2 dropdown filters and then a search feature to narrow down the result from dataset. 

 

1)My first dropdown has duplicate values that I want to remove. 

It seems that the dropdown is looking at individual values from dataset and not grouping them. 

 

2) My 2nd dropdown has full list- i want it to filter based on selection of 1st dropdown.

 

3) The search is working on material description:

SortByColumns(Filter([@'List of Top Ducab Materials'], StartsWith('Material Description',TextSearchBox1.Text)||StartsWith(Text(Material),TextSearchBox1.Text) || StartsWith('Material Description',TextSearchBox1.Text)),"Material",If(SortDescending1,Ascending,Descending))

 

I need both dropdowns and search for material

Please help. 

Thanks.

 

 

 

4 REPLIES 4
eka24
Super User
Super User

Use these steps:

Dropdown1 Items:

Distinct(SPList1,ColumnName)

 

Dropdown2 Items:

Filter(Datasource,ColumnName=Dropdown1.Selected.Result)

 

The Search Formula:

SortByColumns(Filter([@'List of Top Ducab Materials'], StartsWith('Material Description',TextSearchBox1.Text)||StartsWith(Text(Material),TextSearchBox1.Text) || StartsWith('Material Description',TextSearchBox1.Text)&&Dropdown2.Selected.ColumnName),"Material",If(SortDescending1,Ascending,Descending))

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

 

 

 

sahim
Frequent Visitor

Thank you so much @eka24 

The dropdown are functioning correctly.

 

But the search and list is not correct. 

My requirement is for the list gallery to be all the items that are selected in the 1st dropdown. 

 

But the gallery is still showing all the items. 

SortByColumns(Filter([@'List of Top Ducab Materials'], StartsWith('Material Description',TextSearchBox1.Text)||StartsWith(Text(Material),TextSearchBox1.Text) || StartsWith('Material Description',TextSearchBox1.Text)&& Dropdown2.Selected.'Group Description'),"Material",If(SortDescending1,Ascending,Descending))

 

I want the gallery to be showing only the list of the dropdown1: each distict has 10 rows of data. 

Thanks.

 

 

eka24
Super User
Super User

Try
SortByColumns(Filter([@'List of Top Ducab Materials'], StartsWith(Text(Material),TextSearchBox1.Text) || StartsWith('Material Description',TextSearchBox1.Text),'Group Description' = Dropdown2.Selected.'Group Description'),"Material",If(SortDescending1,Ascending,Descending))

or

SortByColumns(Filter([@'List of Top Ducab Materials'], StartsWith(Text(Material),TextSearchBox1.Text) || StartsWith('Material Description',TextSearchBox1.Text)&&'Group Description' = Dropdown2.Selected.'Group Description'),"Material",If(SortDescending1,Ascending,Descending))

 

I realized a repetition of StartsWith('Material Description'

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

sahim
Frequent Visitor

I have now modified it to have only one drop down menu. 

When I enter the below. 

 

SortByColumns(Filter([@'List of Top Ducab Materials'], StartsWith('Group Description',TextSearchBox1.Text)||StartsWith(Text(Material),TextSearchBox1.Text) || StartsWith('Group Description',TextSearchBox1.Text)&& Dropdown1.Selected.Result),"Material",If(SortDescending1,Ascending,Descending))

 

 

I have selected group description but the gallery is showing the complete list. 

My requirement is to show only the values based on the "group description" selected

And then the search feature must work on the gallery values. 

I hope this is clear. 

 

Sorry I am a very new at this hence the changes.

Thanks.

 

 

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

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