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
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

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