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.
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!

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.
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!

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (1,824)