cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Mueller
Frequent Visitor

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
Community Champion
Community Champion

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
v-yamao-msft
Community Support
Community Support

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
Community Champion
Community Champion

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.

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
Community Champion
Community Champion

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

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?

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
Community Champion
Community Champion

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

I appreciate everything that works perfectly!

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (43,499)