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 / If Dropdown Value is 0...
Power Apps
Answered

If Dropdown Value is 0 Then DisplayMode.Disabled

(0) ShareShare
ReportReport
Posted on by 1,401 Moderator

I can't believe this is this difficult, but I'm stuck.

 

I have a button that I want to be disabled if a Dropdown value is 0, which is the first/default value of the dropdown.

 

DisplayMode=

 

If(DrpCoreQuantity.Selected.Value=0,DisplayMode.Disabled,DisplayMode.Enabled)

 

 

What am I doing wrong?

Categories:
  • NandiniBhagya20 Profile Picture
    4,667 Super User 2024 Season 1 on at

    TRy with 0 in quotes 

    If(DrpCoreQuantity.Selected.Value="0",DisplayMode.Disabled,DisplayMode.Enabled)
  • IPC_ahaas Profile Picture
    1,401 Moderator on at

    I'm getting the same error, only it swaps "Number" for "Text"

     

    "Incompatible types for comparison. These types can't be compared: Error, Number/Text

     

    I don't get it, I'm not comparing anything.

  • IPC_ahaas Profile Picture
    1,401 Moderator on at

    The "Items" for the Dropdown has this:

    Table({I:0},{I:1},{I:2},{I:3},{I:4},{I:5},{I:6},{I:7},{I:8},{I:9},{I:10})

    I didn't create this app, but it seems unnecessary to have this when it could just be:

    [0,1,2,3,4,5,6,7,8,9,10]

    Right?

  • NandiniBhagya20 Profile Picture
    4,667 Super User 2024 Season 1 on at

    Yea you can have an array of numbers instead of creating a table

  • IPC_ahaas Profile Picture
    1,401 Moderator on at

    This worked

    If(DrpCoreQuantity.Selected.Value=0,Disabled)

    But now how would I do this if either of two dropdowns were 0?

    Or(If(DrpCoreQuantity.Selected.Value=0,Disabled),If(DrpSafetyQuantity.Selected.Value=0,Disabled))

     

  • Verified answer
    Pratik_elixir Profile Picture
    14 on at

    Please try this 

    If(DrpCoreQuantity.Selected.Value=0||DrpSafetyQuantity.Selected.Value=0,Disabled)

  • Verified answer
    NandiniBhagya20 Profile Picture
    4,667 Super User 2024 Season 1 on at

    If(Or(DrpCoreQuantity.Selected.Value=0, DrpSafetyQuantity.Selected.Value=0), Disabled)

  • IPC_ahaas Profile Picture
    1,401 Moderator on at

    YES! Thank you. Both of those solutions worked. Going with "Or"

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 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 271

#3
Mohsin Ali Profile Picture

Mohsin Ali 223

Last 30 days Overall leaderboard