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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Disable a button based...
Power Apps
Answered

Disable a button based on a dropdown value & dropdown on change event

(1) ShareShare
ReportReport
Posted on by 6
Hello PowerApps Community
I'd like to disable a button based on the value of a dropdown.  The dropdown (drpdProperty_Type) is fed by a table PropertyTable 
 
I have the button's DisplayMode property connected to a formula:
If(drpdProperty_Type.Selected.Property_Type = "Select......" || varOCPropType = "Select......", DisplayMode.Disabled,DisplayMode.Edit)
 
I have a variable varOCPropType connected to the On Change property of drpdProperty_Type as 
Set(varOCPropType,drpdProperty_Type.Selected.Property_Type) which evaluates to a text datatype, as does drpdProperty_Type.Selected.Property_Type = "Select......"
 
The drpdProperty_Type items are set to PropertyTable.
 
When I inspect button DisplayMode,  the IF expression still evaluates to false even when datatype text values are the same and I'm expecting the expression to be evaluated as true.
 
Could you please tell me why this doesn't evaluate to true?
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    153,079 Most Valuable Professional on at
    Firstly Modern Controls are still in Preview and really should not be used in Production apps. I notice that nothing is selected in your screenshot, so you would need to make the DefaultSelectedItems 
    {Value: "Select......"}

    If you had a Classic Combo Box, you could set the InputTextPlaceHolder to "Select......" and then
    If(
       Len(ComboBox.Selected.Property_Type) = 0,
       DisplayMode,Disabled,
       DisplayMode.Edit
    )
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee
  • CH-11102210-0 Profile Picture
    6 on at
    Thank you so much WarrenBelz! 
    As another test,  I created another dropdown with more simple items: 
    ["Item 1", "Item 2", "Item 3"] and the disabled mode evaluated as true. 
    This tells me my values from the dropdown are at fault, so I'll need to revisit those.
    Len(ComboBox.Selected.Property_Type) = 0
    makes perfect sense and seems much more robust. I will give it try! Cheers!

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard