Reputation: 21
In power apps I have created a drop down list called series and another called models. How do I get the drop down in Models to reference an item in the Series drop down? For example, If the series has car, truck, van how to i get the models list to auto populate when car is chosen.
Upvotes: 2
Views: 6711
Reputation: 1
add code on the Model dropdown > Items Properties Filter(SeriesModelTable,SeriesColumn=DropdownSeries.Selected.SeriesColumn)
Upvotes: 0
Reputation: 4365
There are many ways to do this. You need to define your data a bit more in the OP.
Yet another option is:
Concurrent(
ClearCollect(colListOfModels, YourModelDataSource),
ClearCollect(colListOfSeries, YourSeriesDataSource)
)
ddSeries Items Property
colListOfSeries
ddModels Items Property
Filter(colListOfModels, series = ddSeries.Selected.Value)
This assumes two DataSources, two Collections and a Series identifier in the Models Collection.
Upvotes: 0
Reputation: 3615
Here is a simple solution without using Collections.
Step-1 Create two Dropdowns and rename them ddProductCat and ddProductSubCat respectively.
Step-2 Paste this line on the Item property of ddProductCat.
["Car", "Truck", "Van"]
Step-3 Paste below code on the Item Property of ddProductSubCat
If( ddProductCat.SelectedText.Value="Car",["BMW","Volvo", "Audi"],
If(ddProductCat.SelectedText.Value="Van", ["Mersides","Volvo", "Toyota"],
If(ddProductCat.SelectedText.Value="Truck", ["Toyota", "Tata"]
)
)
)
This solution is not recommended if you have bulk data or you may need to add/modify data in the future.
Upvotes: 0
Reputation: 31
To do that you will need to set up some collections to be used in your dropdown , and use condition to make the second dropdown change the values.
Example:
You can add a new button or use the visibility property of the screen and set these collections :
Collect(MyLetters, "A","B","C"); Collect(MyNumbers, "1","2","3");Collect(Roman,"i","ii","iii"); Collect(Dots,"a","aa","aaa")
1- In your DropDown1 , you can set items to MyLetters
2- In DropDown2 set items to the condition like this : If(Dropdown1.Selected.Value= "A",MyNumbers, If(Dropdown1.Selected.Value= "B", Roman, If(Dropdown1.Selected.Value= "C", Dots)))
Thanks,
Eman
Upvotes: 3