cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ha-wold
Frequent Visitor

Issues with cascading combo box

Hello guys, I am encountering an issue with the combo box on the app that I am currently developing using Share point as Data source.

 

Scenario: I have 2 combo boxes which the combo box 1 is showing the results from Column A correctly. Now with my combobox2, the results should be dependent based from the selected result in combobox1 and this is not happening.

 

Below is my code in Items Property for combobox2:

 

Sort(Filter(Distinct('SP Name', ThisItem.'Ticket Number' = DataCardValue24.Selected.Result),Not(IsBlank(Result))),Result)

 

Hawold_0-1642602490932.png

 

However, if I use the following code below in my combobox2, it will return the results that I am expecting BUT it will not filter according to the selected value in combobox2:

 

Sort(Filter(Distinct('SP Name','Test ID'),Not(IsBlank(Result))),Result)

 

Hawold_1-1642602529488.png

 

Please advise.

Thank you so much!

1 ACCEPTED SOLUTION

Accepted Solutions
Ha-wold
Frequent Visitor

This can be close. Updated my combo box2 formula to: 

Filter(Distinct(Filter('SP Name', 'Combo Box 1 ColumnName' = ComboBox2.Selected.Result),'ComboBox Two ColumnName'),Result)

 

 

View solution in original post

3 REPLIES 3
RandyHayes
Super User
Super User

@Ha-wold 

You second formula you presented is not basing itself on combobox 1 at all.  That needs to be added in.

So, based on your first formula, the formula would be:

Sort(
    Filter(
        Distinct(
            Filter('SP Name'
                'Ticket Number' = DataCardValue24.Selected.Result
            ),
            'Test ID'
        ),
        !IsBlank(Result)
    ),
    Result
)

 

As a general note, this formula is yet another trip to the datasource.  Cascading combo and dropdown controls is best done with the GroupBy function, but I am not seeing the Items property of your first combobox to be able to offer a suggestion for that.

 

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!

Hi @RandyHayes 

Thank you so much for your response. I actually tried the formula that you provided but it is still not showing the correct data based from the selection in combo box 1.

Hawold_0-1642649256226.png

 

From my Sharepoint:

Hawold_1-1642649291531.png

 

As for your question, below is the code in the combo box 1 property: 

Sort(Filter(Distinct('SP Name','Ticket Number'),Not(IsBlank(Result))),Result)

 

Please advise. Thank you!

Ha-wold
Frequent Visitor

This can be close. Updated my combo box2 formula to: 

Filter(Distinct(Filter('SP Name', 'Combo Box 1 ColumnName' = ComboBox2.Selected.Result),'ComboBox Two ColumnName'),Result)

 

 

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

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