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

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (4,736)