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

I want to filter a combobox by another combobox

Hi,

I have a Power App with many "ComboBox", 2 of them are "REGIONS" and "CITIES".

I need to filter CITIES by REGIONS, but if REGIONS ComboBox is BLANK, the ComboBox of CITIES doesn't has to be filtered.
Now I can just filter if REGIONS ComboBox is not BLANK. 

But in the moment REGIONS ComboBox is BLANK, the ComboBox of CITIES doesn't show any option.

1 ACCEPTED SOLUTION

Accepted Solutions
Drrickryp
Super User
Super User

@AlexFDS 

Assuming Combobox1's Items are Sort(Distinct(Table, Regions),Result),  Combobox2 should be 

 

Sort(
    Distinct(
        Filter(
            Table,
            IsBlank(ComboBox1.Selected.Result)||Region = ComboBox1.Selected.Result
        ),
        City
    ),
    Result
)

 

 

 

View solution in original post

4 REPLIES 4
Akser
Solution Sage
Solution Sage

Hi @AlexFDS,

 

Could you share the CITIES' formula? The one that works when Region is not empty. 

Drrickryp
Super User
Super User

@AlexFDS 

Assuming Combobox1's Items are Sort(Distinct(Table, Regions),Result),  Combobox2 should be 

 

Sort(
    Distinct(
        Filter(
            Table,
            IsBlank(ComboBox1.Selected.Result)||Region = ComboBox1.Selected.Result
        ),
        City
    ),
    Result
)

 

 

 

Thank you so much it worked.

I was trying with if with 2 different collections and something like that but never worked.

Ur GOD.

Drrickryp
Super User
Super User

@AlexFDS 

Please mark it solved so others can find it.

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.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

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 (5,315)