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

Cascading Dropdowns Onchange choices as radio control

Hi,

 

I am using 3 sp list to make my dropdown lists working and save in the master list

 

Dropdown 1 = Country - onChange

Dropdown 2 = State - onChange

 

List Structure - Country

Country Name

India

Srilanka

Nepal

Fiji

 

List Structure - State

State Name       City Name (Choices)

Maharastra        Pune;Nashik;Nagpur

Gujraat               Ahmedabad;Surat;Vadodara,Rajkot

Karnataka           Banglore,Hubli

 

Dynamic radio button will populated based on selection of state

 

Thanks,

Amit

 

13 REPLIES 13
tchin-nin
Level 10

Re: Cascading Dropdowns Onchange choices as radio control

Hello @AmitSaraswat,

 

My understanding is that you want to populate dynamics choices in Radio Button control according to what has been selected on the 2 dropdown list before ?

On your State list structure don't you miss a junction to the Country list ?

 

Cheers,

Théo

AmitSaraswat
Level: Powered On

Re: Cascading Dropdowns Onchange choices as radio control

Yes country list have the lookup into the state list and based on the state list and diynamics choices in Radio Button control according to what has been selected on the 2 dropdown list before and other dropdown3 also if possible

tchin-nin
Level 10

Re: Cascading Dropdowns Onchange choices as radio control

You might consider using the "Items" property of DropDownLists and Radios instead of OnChange.

 

Here is the Datamodel is used:

ClearCollect(
	Country, 
	{CountryName: "India"}, 
	{CountryName: "Srilanka"}, 
	{CountryName: "Nepal"}, 
	{CountryName: "Fiji"} 
)

ClearCollect(
	CountryState, 
	{CountryName: "India", StateName: "Maharastra", Cities: "Pune;Nashik;Nagpur" },
{CountryName: "India", StateName: "Gujraat", Cities: "Ahmedabad;Surat;Vadodara;Rajkot" },
{CountryName: "India", StateName: "Karnataka", Cities: "Banglore;Hubli" } )

 

Let's say your first ddl "DropDownListCountry" has Items : Country.

 

Then the "Items" property of the second ddl "DropDownListState should be : 

Filter(
    CountryState,
    CountryName = DropDownListCountry.Selected.CountryName
).StateName

 

And the "Items" property of your radio buttons control "RadioCity" should be :

Split(
    LookUp(
        CountryState,
        StateName = DropDownListState.Selected.StateName,
        Cities
    ),
    ";"
)

You have a good example of using the Filter function, to retrieve several entries according to a filter (the country name),  and the Lookup function, to use a property of an item retrieved according to a filter (the state name).

 

Let me now if you need more explanations,

Cheers

Théo

Community Support Team
Community Support Team

Re: Cascading Dropdowns Onchange choices as radio control

Hi @AmitSaraswat,

 

Could you please share more details about the Country List and State List that you mentioned?

 

I agree with @tchin-nin's thought almost, I think there is a column which references values from your Country list within your State list. In addition, I suppose that the City Name is a Choice type column which allows multiple values in your State list, is it true?

 

I have created two SP lists on my side, the data structure as below:6.JPG

 

7.JPG

Note: The Country column in my State list is a Lookup type column.

 

I have made a test on my side, please take a try with the following workaround:8.JPG

 

9.JPG

 

 

Set the Items property of the CountryDropdown to following formula:

Distinct('20180809_case10_CountryList',CountryName)

Set the Items property of the StateDropdown to following formula:

Filter('20180809_case10_StateList',Country.Value=CountryDropdown.Selected.Value).StateName

Set the Items property of the Radio control to following formula:

LookUp('20180809_case10_StateList',StateName=StateDropdown.Selected.Value,CityName)

Or

First(Filter('20180809_case10_StateList',StateName=StateDropdown.Selected.Value)).CityName

 

Best regards,

Kris

 

 

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
AmitSaraswat
Level: Powered On

Re: Cascading Dropdowns Onchange choices as radio control

As its working for populated the cascading dropdown and radio button but data is not saved into MasterList.

 

I have attached the lists snapshot for reference.

 

 

 

 

tchin-nin
Level 10

Re: Cascading Dropdowns Onchange choices as radio control

Hi,
May we have more detailed about the master list ? What types are these column ? Single line of text ? Lookup for some of them ?

Also we will need more details about the way you're trying to save your data. Are you using a form control ?

Théo
AmitSaraswat
Level: Powered On

Re: Cascading Dropdowns Onchange choices as radio control

Yes, this is a sharepoint customize form and in master lists, i have created the 3 lookup column and i want to save the data into the master list.


for saving :-  in DataCard - update property - dropdowncountry.selected not working to save the data into the list even i have tried the dropdowncountry.selected.value giving me error

 

 

AmitSaraswat
Level: Powered On

Re: Cascading Dropdowns Onchange choices as radio control

Hi tchin-nin,I have also tried to change those column into single line of text but still getting error (attached)

 

Your kind assistance on this is very much appreciated

tchin-nin
Level 10

Re: Cascading Dropdowns Onchange choices as radio control

Hi @AmitSaraswat,

 

I haven't played with SharePoint customize forms in PowerApps.

I have faced some trouble too trying to cascading loop up SharePoint column with the native Combobox control. I need to push my tests to figure out how we can perform that cascading using this control.

So instead of using this Combobox control, you can change it for a Dropdown list. You will be able to filter a lookup column, but the dropdown control doesn't allow multi-selection, so this workaround will work only if your lookup column accepts only one value.

 

Inside your look up column datacard, add a Dropdown control. You may copy/paste some relative parameters of the auto generated Combobox control like Y and Width. You can delete the Combobox, and doing so you will have some error in the ErrorMessage label Y property due to reference to the deleted Combobox, just replace the references to your new dropdown control.

 

You can configure your dropdown Item property to filter your looked up list according to another form control value:

Filter('LookedUp List',Column.Id=DataCardValue1.Selected.Id) --As explained before 

 

Now on the Update property of your DataCard, use this to update a Lookup column in SharePoint

{Id: Dropdown2.Selected.ID

,Value: Dropdown2.Selected.FullName

,'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"}

 

Haven't tried with Radio button but I guess the same kind of workaround should work.

 

Let me know how it goes for you,

Théo

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: 126 members 3,240 guests
Please welcome our newest community members: