web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Disable/Enable dropdow...
Power Apps
Answered

Disable/Enable dropdown based on dropdown selection

(0) ShareShare
ReportReport
Posted on by 517

Hi all

 

how can I disable certain fields based on my dropdown selection?

 

For example, if I pick packaging supply disable ingredients and ingredients supplier fields (marked on x):

 

234234.JPG

 

Please note these are combo box from Sharepoint list:

 

231dsf.JPG

 

Thanks!

 

 

Categories:
  • Pstork1 Profile Picture
    69,665 Most Valuable Professional on at

    Use an IF() in the displayMode property of the dropdown you want to disable and check it against the selected.Value of the dropdown that should disable it.  If the selected.value is equal to the value that should disable the control then set it to displayMode.disabled.  Otherwise set it to displayMode.Edit. You will need to unlock the card in advanced settings first.

  • diegoandre10 Profile Picture
    517 on at

    Hi @Pstork1 

     

    Thanks for the response. I am not the best with the Power Apps syntax, I tried this with your recommendation:

     

    First, I renamed the box to Scope: 

    lkldkfldsf1.JPG

     

     

     

    I went to the box Ingredients, so basically if Scope combo box = "Ingredients supply" then let use the dropdown, if not disable the box:

     

    dsfdsf981.JPG

     

    Can you please advise how to code it properly?

     

    Thanks!

  • Verified answer
    Pstork1 Profile Picture
    69,665 Most Valuable Professional on at

    If you've unlocked the card so you can edit the displayMode it should be something very close to this.

    If(Scope.Selected.Value = "Ingredients supply", DisplayMode.Disabled, DisplayMode.Edit)
  • diegoandre10 Profile Picture
    517 on at

    Hi @Pstork1 

     

    Correct it's unlocked. I pasted your code and tried with F5 but it didn't work:

     

    kasdsakjkj1.JPG

     

    Should't I use the combobox that references to the SP list somewhere too? In this it's: Choices([@'BCP LATAM'].Ingredients)

     

    So for example, if you select in Scope "Ingredients supply" then display Choices([@'BCP LATAM'].Ingredients) if false then disable the ingredients field.

     

    Thanks!

  • diegoandre10 Profile Picture
    517 on at

    Hi @Pstork1 

     

    I tried this way, initially there seems to be no error:

     

    sakdjsakj1.JPG

     

    When I hit F5 no test, it doesn't work either.

     

    lkfdsjk1.JPG

     

    Any idea?

     

    Thanks 🙂

  • Pstork1 Profile Picture
    69,665 Most Valuable Professional on at

    Are you putting the formula in the Ingredients displaymode or Scope displaymode?  It has to be the Ingredients displaymode since that is the dropdown you are trying to disable.  Choices() has nothing to do with it.

  • diegoandre10 Profile Picture
    517 on at

    Awesome @Pstork1 ! it worked, thanks so much.

     

    Just one final detail it came up after using your solution. I am trying to reset the packaging supplier and packaging dropdowns whenever the user changes the scope to something different than "Packaging supply" on scope.

     

    For example if I select "Packaging supply" under scope and add values for packaging supplier and packaging, but then instead as a user I want to change it to "Ingredients supply" scope, it looks disabled with values:

    asdasd1.JPG

     

    I tried the following solution under OnChange option for packaging supplier field:

     

    sakljdlkj1.JPG

     

     

    If(Scope.Selected.Value = "Packaging supply",false, Reset(Scope))

     

     

    The logic I thought was, If user selects "Packaging supply" scope then do nothing for field "packaging supplier" else reset the field packaging supplier. However it didn't work.

     

    Can you help getting it right?

     

    Thanks!

  • Pstork1 Profile Picture
    69,665 Most Valuable Professional on at

    It should work, but there is a mistake in your code.  The reset() should be the control you want to reset, not scope. Something like:

    If(Scope.Selected.Value = "Packaging supply",false, Reset('Packaging Supplier'))

       And it should be in the OnChange event for Scope.

  • diegoandre10 Profile Picture
    517 on at

    Hi @Pstork1 

     

    I tried but it didn't work. Please take a look at this one minute video I recorded with MSFT stream and uploaded to Drive:

    https://1drv.ms/u/s!ApgeWwGTKtFdh1CO7oUh449koNB3?e=n0kj4I

     

    Since all the code has to go under scope, shouldn't it be a clustered if? Something like this:

     

    lksadjlksajd.JPG

     

    Thanks once again for your help!

     

    Diego.

  • Pstork1 Profile Picture
    69,665 Most Valuable Professional on at

    I created a simple example.  Take a look at the following video

    https://acmee3-my.sharepoint.com/:v:/g/personal/pstork_acmeman_com/EfGroRzy9DdEnHDwyXKCqkABoEuQi3FdLwhBq_viIZu5vg?e=YF6VfZ 

    The video shows two Dropdown controls.

    OnChange for Scope control

     

     

    If(Scope.Selected.Value = "2",Reset(Packaging))

     

     

    DisplayMode for Packaging control

     

     

    If(Scope.Selected.Value = "2",DisplayMode.Disabled,DisplayMode.Edit)

     

     

    As you will see from the video.  Selecting 2 in the Scope dropdown will disable the Packaging dropdown and reset it to its default value.  To disable/reset another dropdown you just add another line to the ONChange and the code to the Display mode of that control. You don't need to reset it for all the choices, just the one where it is disabled.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 234 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 207 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 169

Last 30 days Overall leaderboard