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

Changing the value of a Dropdown box based on a selected value in another dropdown value

Hi Experts,

 

I have a sharepoint form with two dropdown combo boxes. 

I would like to achieve the following.

If a user selects a particular value in DropdownA I would like DropdownB to be set to a specific value and disabled.

 

Disabling Dropdown B is a synch. 

Dropdown B’s DisplayMode: If(DropdownA.Selected.Value = “particular value”, Disabled, Edit)

 

But getting the value to set in DropdownB is proving to be a challenge.

What I’ve tried:

 

1. Setting a variable

DropDownA OnSelect event: If(DropdownA.Selected.Value = “particular value”, UpdateContext({varXX:true}), UpdateContext({varXX:false}))

DropDownB Default: If(varXX, Lookup(Choices(‘Share Point List’, ‘List Column’), value=“specific value”), Parent.Default))

 

2. Setting the Default depending on DropDownA’s selected value

DropDownB Default: If(DropDownA.Selected.Value = “particular value”, Lookup(Choices(‘Sharepoint List’, ‘list column’), value=“specific value”, Parent.Default)) 

And

DropDownB Default: If(DropDownA.Selected.Value = “particular value”, “specific value”, Parent.Default)) —> This does not work as it is expecting an object but gets text instead.

 

Looking to you for advise on how to achieve the desired outcome. This to me should be pretty simply, but I’ve been banging my head trying to figure it out.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft v-siky-msft
Microsoft

Re: Changing the value of a Dropdown box based on a selected value in another dropdown value

Hi @Gunsmoke125

 

Two things to confirm:

1. What are the types of two columns?  Could you please share the Items property of two dropdown?

2. Do you use Drop Down or Combo box? 

 

If the column is choices type and you use the dropdown, set Default of DropDownB:

 

If(DropdownA.Selected.Value="particular value",LookUp(Choices('Sharepoint List'. 'Choices Column'),Value="specific value").Value)

 

Note: Parent.Default is not fit for dropdown.

If the column is choices type and you use the combo box, set DefaultSelectedItems of DropDownB:

 

If(DropdownA.Selected.Value="particular value",LookUp(Choices('Sharepoint List'. 'Choices Column'),Value="specific value"), Parent.Default)

 

Annotation 2019-11-20 170042.png

At last, I recommend to use combo box.

Best regards,

Sik 

View solution in original post

2 REPLIES 2
Microsoft v-siky-msft
Microsoft

Re: Changing the value of a Dropdown box based on a selected value in another dropdown value

Hi @Gunsmoke125

 

Two things to confirm:

1. What are the types of two columns?  Could you please share the Items property of two dropdown?

2. Do you use Drop Down or Combo box? 

 

If the column is choices type and you use the dropdown, set Default of DropDownB:

 

If(DropdownA.Selected.Value="particular value",LookUp(Choices('Sharepoint List'. 'Choices Column'),Value="specific value").Value)

 

Note: Parent.Default is not fit for dropdown.

If the column is choices type and you use the combo box, set DefaultSelectedItems of DropDownB:

 

If(DropdownA.Selected.Value="particular value",LookUp(Choices('Sharepoint List'. 'Choices Column'),Value="specific value"), Parent.Default)

 

Annotation 2019-11-20 170042.png

At last, I recommend to use combo box.

Best regards,

Sik 

View solution in original post

Gunsmoke125
Level: Powered On

Re: Changing the value of a Dropdown box based on a selected value in another dropdown value

@v-siky-msft thank you. Yes you correctly identified that the form is using Combo Box and your suggestion to put the code into the DefaultSelectedItems property was the thing that clinched my problem.

 

Thanks for taking the time to respond with such a detailed and useful explanation. Greatly appreciated.

 

Kindest Regards

 

DJ

Helpful resources

Announcements
thirdimage

Power Platform 24

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

Top Solution Authors
Top Kudoed Authors
Users online (4,787)