cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jaos291
Level: Powered On

Filter DataTable with dropdown

Hi,

 

I have a DataTable connected to a SPList and I want to apply a filter according to some Dropdowns

Lets say I have 3 dropdowns with "System", "CompanyName" and "Process". If someone chooses one option from System dropdown, the table will filter all the info according to the System selected, then if someone chooses a Process, the table will be filtered with the selected System and the selected Process, and so.

The problem is that my DataTable kind of filters in random way, sometimes it filters sometimes it doesnt, I only want an idea how to make this possible because I have like 5 or 6 Dropdowns so I need to combine many If with || ( Or ) function

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Filter DataTable with dropdown

hi @Jaos291,

 

Can you share a bit more about your issue?

Do you use a dropdown control or combo box control to display the options.

I assume using combo box control to display the options .

I made a test.

I created a SP list named “datatable”.

8.PNG

 

Set the item property of the gallery to:

Filter(Datatable,If(IsBlank(ComboBox1.Selected.system),true,system=ComboBox1.Selected.system)&&If(IsBlank(ComboBox2.Selected.companyname),true,ComboBox2.Selected.companyname=companyname)&&If(IsBlank(ComboBox3.Selected.process),true,process=ComboBox3.Selected.process))

 

regards

eason

Community Support Team _ Eason YU
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

2 REPLIES 2
Super User
Super User

Re: Filter DataTable with dropdown

Filtering on on the DataTable works the same as the filtering on Galleries. 

 

If you have multiple dropdowns you need to decide first if you want Or or if you want And. Or is probably not best because it will basically only put one at a time so I would suggest using AND. If you want to allow them to not use all the dropdown then you can include an If statement that says If Dropdown2 is blank then only look at Dropdown1 and so on (I can help you more with that if you need)

 

So, using And if you just have two drop downs you would put on the items for the DataTable

 

Filter(SPListName,Column1.Value=Dropdown1.Selected.Value && Column2.Value=Dropdown2.Selected.Value)

 

You can go on as long as you need to but that is the basics of it. 

 

Also, I put on here how to do for dropdown because that is what you were using but I would suggest you do combo boxes instead...it allows for autofill so good for users and when you want to clear it out you can just click the X instead of having to put in code for that. You won't have to change anything on the SPList to swap to that, just a different control. But everybody is different...just my two cents for what it is worth.

 

 

Community Support Team
Community Support Team

Re: Filter DataTable with dropdown

hi @Jaos291,

 

Can you share a bit more about your issue?

Do you use a dropdown control or combo box control to display the options.

I assume using combo box control to display the options .

I made a test.

I created a SP list named “datatable”.

8.PNG

 

Set the item property of the gallery to:

Filter(Datatable,If(IsBlank(ComboBox1.Selected.system),true,system=ComboBox1.Selected.system)&&If(IsBlank(ComboBox2.Selected.companyname),true,ComboBox2.Selected.companyname=companyname)&&If(IsBlank(ComboBox3.Selected.process),true,process=ComboBox3.Selected.process))

 

regards

eason

Community Support Team _ Eason YU
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

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 332 members 5,662 guests
Please welcome our newest community members: