web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filter DataTable with ...
Power Apps
Answered

Filter DataTable with dropdown

(0) ShareShare
ReportReport
Posted on by

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

Categories:
I have the same question (0)
  • rebeccas Profile Picture
    2,591 on at

    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.

     

     

  • Verified answer
    v-sheyu-msft Profile Picture
    on at

    hi @Anonymous,

     

    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard