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

Set Enabled/Disabled with change on a Dropdown/List

Hey guys

 

Just as the title says, I'm trying to set Enabled or Disabled some buttons and labels according to the users selection on a Dropdown / List. I tried to set the Buttons/Labels to disabled if the SelectedItem.Value of the list is equal to a "string", set OnChange, but it seems I'm not doing it right, I also tried OnSelect. Any tip will be helpful 

If I'm not clear enough please ask

Thank You

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Set Enabled/Disabled with change on a Dropdown/List

Hi @Jaos291,

A good way to do this is to create a context variable when some action is true.  The action would be in the OnChange property of the Dropdown control.  Set the OnChange to If(Dropdown1.Selected.Value="yourvalue", UpdateContext({var:true}),UpdateContext({var:false})).  Then set the Button's DisplayMode property to If(var,Edit,Disabled).  Similarly, you can use the context variable "var" to hide or show labels and textboxes by setting the Visible property to var.  

View solution in original post

1 REPLY 1
Super User
Super User

Re: Set Enabled/Disabled with change on a Dropdown/List

Hi @Jaos291,

A good way to do this is to create a context variable when some action is true.  The action would be in the OnChange property of the Dropdown control.  Set the OnChange to If(Dropdown1.Selected.Value="yourvalue", UpdateContext({var:true}),UpdateContext({var:false})).  Then set the Button's DisplayMode property to If(var,Edit,Disabled).  Similarly, you can use the context variable "var" to hide or show labels and textboxes by setting the Visible property to var.  

View solution in original post

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

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

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,099)