cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ImageZ
Regular Visitor

Cascading Dropdown on lists with lookups

Hey,

 

Done a lot of googling and checking round but still can't seem to find the right fix. I have 2 tables and a form......

 

Table 1 -

Name: Lookup - CallTypes

Columns: "Primary" and "Secondary" (both are single line of text)

 

Table 2 

Name: Demand Tracker

Columns: "Brand" (Choice), "Primary" (lookup from table 1), "Secondary" (lookup from table 1)

 

Form

Fields: "Brand" (radio button), "dropdown1" (primary demand), "dropdown2" (secondary demand) - both the demands are taken from the "Demand Tracker" table not the original lookup table.

 

I can get the primary working by using "Distinct(Choices('Customer Demand Tracker'.'Primary Demand'),Value)", which is fine - but for the life of my I cannot get the secondary to pull through the corresponding items (see ss)

 

Help would be appreciated as this has my head done in!

1 ACCEPTED SOLUTION

Accepted Solutions

@ImageZ ,

The first error is your column name 'Primary Demand', which I assumed from your post, so that needs to be corrected. Other than that, it was just missing a comma (now corrected).

 

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.

Visit my blog Practical Power Apps

View solution in original post

6 REPLIES 6
WarrenBelz
Super User
Super User

Hi @ImageZ ,

So I can understand what you are saying - I assume 'Secondary Demand' is a Lookup field in 'Customer Demand Tracker' and this does not give a Distinct list as the Items of a Combo Box

Distinct(
   Choices('Customer Demand Tracker'.'Secondary Demand'),
   Value
)

Please confirm before we go further

 

Hey,

 

Yeah that would work but I want the secondary dropdown to be filtered depending on what item is selected in the first - sorry didnt mention that part!

 

Hi @ImageZ ,

Then you cannot use Choices as they have no connection to the first drop-down. You have to use the existing values in the list to filter - I am trying to avoid a Delegation warning with this, but the top filter is still subject out an output of record numbers up to the limit. This would also be easier if 'Secondary Demand' was a Text field.

With(
   {
      wPrim:
      Filter(
         SPListName,
         'Primary Demand'.Value = Dropdown1.Selected.Value
      )
   },
   Distinct(
      AddColumns(  
         wPrim,
         "SecDemand",
         'Secondary Demand'.Value
      ),
      SecDemand
   ).Result
)

 

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.

Visit my blog Practical Power Apps

hey mate, tried that but received 2 different error messages (see attached). There wont be any existing to use as it's a lookup from the first table. 

 

I think im missing a connection to the first table so will try that 

@ImageZ ,

The first error is your column name 'Primary Demand', which I assumed from your post, so that needs to be corrected. Other than that, it was just missing a comma (now corrected).

 

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.

Visit my blog Practical Power Apps

ImageZ
Regular Visitor

Hey,

 

So i realised I hadnt connected the right able, I've now got the cascading drodowns to work by looking at the actual lookup table rather than the results table (which will be blank before stuff gets entered). However now when changing the Primary Demand and Secondary Demand in the Customer Demand (results) table, i get an error "Object must implement IConvertible"

Helpful resources

Announcements
Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

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.

<
Users online (3,549)