cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Mueller
Level: Powered On

Using one Drop Down selection fill another drop down

At the moment I have this code.

 

If('Department Drop'.Selected.Departments = "IT", IT_Department.IT, 'Department Drop'.Selected.Departments = "Sales", Sales_Department.Sales)

 

the IT_Department.IT is the data table and column the data is in. same with the Sales_Department.Sales. I am constantly recieving the error of "the columns produced by this rule are all nested tables and/or records". I can't go any deeper into the lists since this is where the data is but I dont know how to fix it.

1 ACCEPTED SOLUTION

Accepted Solutions
Meneghino
Level 10

Re: Using one Drop Down selection fill another drop down

I see.  I would suggest having one table instead.  This table would look like the screenshot below.

 

Then I would use this:

 

Filter(Product_types, Department = 'Department Drop'.Selected.Values).ProductType

__.JPG

View solution in original post

8 REPLIES 8
Community Support Team
Community Support Team

Re: Using one Drop Down selection fill another drop down

Hi Mueller,

 

I assume you should have two SharePoint lists, IT list and Sales list. Do you have created a connection to both these two lists?

 

I test this on my side, my steps for a reference:
1. Create a connection to two SharePoint lists named as “Employee”, “LeaveRequest”.
2. Add a Drop down control, set its items property as: ["LeaveRequest","Employee"]
3. Add another Drop down control, set its items property as:

If(Dropdown1.Selected.Value="LeaveRequest",LeaveRequest.Title,Dropdown1.Selected.Value="Employee",Employee.Title)

Then when I select “LeaveRequest” in the Drop down1, corresponding Title would be shown on the app.

dropdown.PNG

 

Hope my steps could be a reference for you.

 

Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Meneghino
Level 10

Re: Using one Drop Down selection fill another drop down

Hi @Mueller, one debugging technique I use is to create a button on the screen and set its OnSelect property to something like

ClearCollect( TestCollection, IT_Department.IT)

Then press the play button, press the button you created, go back to the App designer and look at the contents of TestCollection in the Content tab of the designer.  This way you can look at the structure of what your result is and also click through the nested columns to check if all is as you would expect.

 

Please let me know if this is clear and how you get on.

Mueller
Level: Powered On

Re: Using one Drop Down selection fill another drop down

If you don't mind answering another question since it didn't help the error I have been getting about the nested list.

 

I am using a single excel sheet for both Product_Type.IT and Product_Type.Sales. I would show a picture but I can't get this uploader to work. Basically it looks like A1:A4 is header IT, then type 1 - 3 in the actual column. Then B1:B4 looks the same but with Sales as the header. When I call the same column as in both Product_Type.IT or both Product_Type.Sales like 

 

If('Department Drop'.Selected.Values = "IT", Product_Type.IT, 'Department Drop'.Selected.Values = "Sales", Product_Type.IT)

 

then I don't get the nested table error? It is only when the two options are different like.

 

If('Department Drop'.Selected.Values = "IT", Product_Type.IT, 'Department Drop'.Selected.Values = "Sales", Product_Type.Sales)

 

which is what I need

Meneghino
Level 10

Re: Using one Drop Down selection fill another drop down

OK, try to remove the dots in your header names: Product_Type.IT -> Product_type_IT and Product_Type.Sales -> Product_type_Sales

 

You will need to refresh the source to see the changes.

 

Always a good idea to avoid special characters (. & $ etc.) in column names

Mueller
Level: Powered On

Re: Using one Drop Down selection fill another drop down

No, no the table name is Product_Type and the columns are named IT and Sales. Would it be better to use two different tables instead of specifying columns in a table?

Mueller
Level: Powered On

Re: Using one Drop Down selection fill another drop down

No, no the table name is Product_Type and the columns are named IT and Sales. Would it be better to use two different tables instead of specifying columns in a table?Capture.PNG

Meneghino
Level 10

Re: Using one Drop Down selection fill another drop down

I see.  I would suggest having one table instead.  This table would look like the screenshot below.

 

Then I would use this:

 

Filter(Product_types, Department = 'Department Drop'.Selected.Values).ProductType

__.JPG

View solution in original post

Mueller
Level: Powered On

Re: Using one Drop Down selection fill another drop down

I appreciate everything that works perfectly!

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 306 members 3,241 guests
Please welcome our newest community members: