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

Conditional Filtering in the Items of a dropdown input?


I know that it's possible to filter a gallery based on a dropdown, but I wanted to know if it is possible to do the opposite as well?  

 

I have a gallery where users will go and update two columns of each row by using a dropdown.

1.png

 

My question is, can you filter what appears in the Items of each drop down based on what the selected row's "Item Type" is?

 

I was thinking of doing this by creating a collection and putting that in the Items of each dropdown - but that keeps giving me errors. How can I create conditional filtering within the dropdown Items?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@cmnflom 

Yes this can be done.  First, skip the collections and just put it in your Dropdown Items property.

 

ex. with static values:

Switch(ThisItem.ItemType, 
    "ItemA", ["Option1", "Option2", "Option3"],
    "ItemB", ["OptionY", "OptionZ"]
//...etc...
)

With Dynamic Values:

Switch(ThisItem.ItemType, 
    "ItemA", Choices([@someListA].SomeColumnA]),
    "ItemB", RenameColumns(Distinct(someListB, SomeColumnB), "Result", "Value")
    "ItemC", RenameColumns(Filter(SomeListC, SomeCriteria=SomeCriteria).SomeColumnC, "SomeColumnC", "Result")
//...etc...
)

The options are endless!!

 

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.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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

View solution in original post

1 REPLY 1
RandyHayes
Super User
Super User

@cmnflom 

Yes this can be done.  First, skip the collections and just put it in your Dropdown Items property.

 

ex. with static values:

Switch(ThisItem.ItemType, 
    "ItemA", ["Option1", "Option2", "Option3"],
    "ItemB", ["OptionY", "OptionZ"]
//...etc...
)

With Dynamic Values:

Switch(ThisItem.ItemType, 
    "ItemA", Choices([@someListA].SomeColumnA]),
    "ItemB", RenameColumns(Distinct(someListB, SomeColumnB), "Result", "Value")
    "ItemC", RenameColumns(Filter(SomeListC, SomeCriteria=SomeCriteria).SomeColumnC, "SomeColumnC", "Result")
//...etc...
)

The options are endless!!

 

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.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

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