cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Post Patron
Post Patron

Cascading dropdown on a lookup column

Hello,

 

I'm sure this has been posted before but I've not been able to follow any of the threads to get this to work. 

 

I have a SharePoint custom form that I've created in PowerApps. In it, I have 2 look up fields(combo boxes); State Lookup and Hotel Name New. These are looking up to a list called 'Master Property List'

 

Formula for Items on "State Look Up" is currently:

Sort(Distinct(Choices('HAFS US OTC Help Desk Ticket Log'.'State Lookup'),Value),Result)

 

I want to have the drop down for "Hotel Name New" function as a cascading drop down and only show values when the "State Lookup" selected value/result? is equal to "State" in the 'Master Property List'. I've tried a thousand different formula combinations for this and have had no success so far. Thank you so much for any help!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Champion
Community Champion

Re: Cascading dropdown on a lookup column

Hi @CarlHRVA
I am assuming your code below produces a valid result when providing a possible solution.
Your first dropdown (I will call it StateLookup) has the Items property

Sort(
   Distinct(
      Choices(
         'HAFS US OTC Help Desk Ticket Log'.'State Lookup'
      ),
      Value
   ),
   Result
)

I am wondering why a Choices field needs a Distinct filter, however the output of this should be<

StateLookup.Selected.Result

You now want to filter a further lookup when this output is equal to State in the list 'Master Property List'
So the Items property of this gallery should be

Filter(
   'Master Property List'
   State = StateLookup.Selected.Result
)
.State

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

6 REPLIES 6
Highlighted
Community Champion
Community Champion

Re: Cascading dropdown on a lookup column

Hi @CarlHRVA
I am assuming your code below produces a valid result when providing a possible solution.
Your first dropdown (I will call it StateLookup) has the Items property

Sort(
   Distinct(
      Choices(
         'HAFS US OTC Help Desk Ticket Log'.'State Lookup'
      ),
      Value
   ),
   Result
)

I am wondering why a Choices field needs a Distinct filter, however the output of this should be<

StateLookup.Selected.Result

You now want to filter a further lookup when this output is equal to State in the list 'Master Property List'
So the Items property of this gallery should be

Filter(
   'Master Property List'
   State = StateLookup.Selected.Result
)
.State

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

Highlighted
Post Patron
Post Patron

Re: Cascading dropdown on a lookup column

Thanks for responding @WarrenBelz . The state look up is distinct because there are multiple values for the state in the look up column and I only want to show one per state. Unfortunately, this formula didn't work for me. Also, in my first formula I'm referencing the look up column in the ticket log and in the second formula I'm referencing the Master Property List directly, is this correct? Here is the error I'm getting using the formula:

 

Capture.PNG

 

 

Highlighted
Community Champion
Community Champion

Re: Cascading dropdown on a lookup column

Hi @CarlHRVA ,

I just used StateLookup as I did not know the name of your ComboBox/DropDown control - just replace this with the actual name.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Highlighted
Post Patron
Post Patron

Re: Cascading dropdown on a lookup column

@WarrenBelzit actually is the name of the look up column in the previous step it just has a space in it😂 The field was missing the space in the formula before but still getting the same error:

 


Capture.PNG

 

 

 

Highlighted
Community Champion
Community Champion

Re: Cascading dropdown on a lookup column

Hi @CarlHRVA ,

You need the name of the ComboBox control, not the field name.

Highlighted
Post Patron
Post Patron

Re: Cascading dropdown on a lookup column

@WarrenBelzOh, I'm an idiot. It was DataCardValue20. The formula works now but the data it's returning should be Hotel Name. I made this small adjustment and it seems to work now! Thank you so much

 

Capture.PNG

 

 

Helpful resources

Announcements
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (9,472)