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 / Enable / Disable Butto...
Power Apps
Answered

Enable / Disable Button - Navigate to new page

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Question1.pngI have a dropdown, a text field (warning), and a button. 

 

I would like to accomplish the following:

 

  1. Make the button disabled when a user accesses this screen
  2. When a value has been selected in the drop down, the button is enabled
  3. When the button is pressed with a value in the dropdown, it navigates to another screen.
  4. When the button is pressed when there is no value in the dropdown, the warning appears and the button is still disabled.

Thanks!! 🙂

Categories:
I have the same question (0)
  • CarlosFigueira Profile Picture
    Microsoft Employee on at

    You can set the DisplayMode property of the button to the expression below:

    If(IsBlank(ComboBox1.Selected), DisplayMode.Disabled, DisplayMode.Edit)

    Where 'ComboBox1' is the name of the control that has the answers. This way, the user will not be able to pressthe button until he/she has selected an answer. See the attached app for an example.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @Anonymous,

     

    make use of a locale variable.

     

    Set for your screen.onvisible attribute something like:

    UpdateContext({disabled:true})

    For the dropdown.onchange attribute you set disabled value to false:

    UpdateContext({disabled:false})

    And for the button.displaymode attribute use this:

    If(disabled, DisplayMode.Disabled, DisplayMode.Edit)

     

    You can check for a button state but I think its not possible to fire a click event on a disabled button. As a long way around you could lay an invisible button (no text, no colors, but not "not visible") over the disabled one. This helper button is only visible if the original button is disabled. Then you could use the onselect attribute of this button to change a variable (like above) and show up your warning.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Perfect!! How do I display the error warning message when the button is clicked and there's no dropdown value?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Ohh, actually saw @CarlosFigueira answer. Thats a better solution I think 🙂

  • Verified answer
    CarlosFigueira Profile Picture
    Microsoft Employee on at

    The user won't be able to click on the button if there's nothing selected in the combo box - the button will be disabled. If you want to add a message to the user, you can always use a label that only shows up when there is no selection. For example, in the screen below:

    ForumPost001.png

    The label only appears when there's no selection. Once the user selects the answer, then the message disappears:

    ForumPost002.png

    You can do that by setting the Visible formula of the label to:

    IsBlank(ComboBox1.Selected)

    Where 'ComboBox1' is the name of the control that has the answers.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    That was a great idea!!! Thanks everyone!!!! 

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard