cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JBennett12
Helper III
Helper III

I want to filter choices from my Process column based on my Location column.

I have an equipment List that contains the location of the equipment, the code of the location, and the process that the equipment is used in. I'm trying to build an app where the location will be a drop down box, and based on that selection it will filter out all the processes that aren't in the record as that location. A screenshot of the list will be below.

 

Example If Japan is selected as the location, the process drop down should only show DS1, DS2, DS3, and DS4. 

 

Is there a way to do this?

Thank you,

JBennett12_0-1662062410258.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
jatcube
Solution Supplier
Solution Supplier

By the looks of it, both Location and Process column are SharePoint choices columns. So, if you want to have two connected dropdowns based on the selected values from location, you can add the first Location dropdown and set its Items value to

Distinct(yourDataSource, Location.Value)

and for the second Process dropdown, set its items property to

Distinct(Filter(yourDataSource, Location.Value = Dropdown1.Selected.Result).Process, ThisRecord.Process.Value)

 

View solution in original post

4 REPLIES 4
RandyHayes
Super User
Super User

@JBennett12 

Add a combobox for your filtering and set the Items property to: Choices(yourList.Location)

Set it for multiple selections.

Your gallery Items property then would be:

Filter(yourList,
    Location.Value in comboboxAdded.SelectedItems.Value
)

If your list is not expected to exceed 2000 records, then the above will work fine.  It will have a delegation warning, but it can be ignored if you don't exceed the maximum.

 

If your list exceeds 2000, then you will need to consider a different approach.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
jatcube
Solution Supplier
Solution Supplier

By the looks of it, both Location and Process column are SharePoint choices columns. So, if you want to have two connected dropdowns based on the selected values from location, you can add the first Location dropdown and set its Items value to

Distinct(yourDataSource, Location.Value)

and for the second Process dropdown, set its items property to

Distinct(Filter(yourDataSource, Location.Value = Dropdown1.Selected.Result).Process, ThisRecord.Process.Value)

 

@jatcube 

So this worked how I wanted it to, however a new (hopefully dumb mistake by me) problem has popped up. Now I can't see any of the location choices. I checked all of the common stuff visibility, text color, background color, anything that would make the choices invisible. Everything is the default. Is there something with the function you provided that would make the choices invisible? But whenever I hover my cursor in the box, it highlights individual choices and when I click the process field does filter with the choice. I just can't see the location choices.

JBennett12_0-1662125490640.png

 

Thank you again for the help. Once I figure out this hopefully small issue I can start styling this project.

 

jatcube
Solution Supplier
Solution Supplier

@JBennett12 that control named Location does not look like a drop-down to me. Are you getting any error messages anywhere? Not sure I understand how you can select items if they are not visible..

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,622)