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 buttons...
Power Apps
Answered

Enable/Disable buttons on select

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

 

I am super new to powerapps, but trying to get my teeth into it.

 

I have three buttons:

 

  • YesButton
  • NeutralButton
  • NoButton

When the YesButton is selected, I want it to be the only button visible of these three, when the NeutralButton is selected, I want it to be the only button visible of these three and when the NoButton is selected, I want it to be the only button visible on this page.

 

How do I achieve this?

 

I have tried this - UpdateContext({NeutralButton: false}) as the OnSelect formula for YesButton as per this post , but that doesn't seem to work for me.

 

Thank you n advance.

 

Jon

 

Categories:
  • Verified answer
    yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @Anonymous 

     

    Can you try to setup the config like:
     
    Screen -> OnVisible -> Set(SelectedButton,Blank())
     
    YesButton -> OnSelect -> Set(SelectedButton,"yes")
    YesButton -> DisplayMode-> If(SelectedButton= "yes" || IsBlank(SelectedButton), DisplayMode.Edit, DisplayMode.Disabled)
     
    NeutralButton -> OnSelect -> Set(SelectedButton,"neutral")
    NeutralButton -> DisplayMode-> If(SelectedButton= "neutral" || IsBlank(SelectedButton), DisplayMode.Edit, DisplayMode.Disabled)
     
    NoButton -> OnSelect -> Set(SelectedButton,"no")
    NoButton -> DisplayMode-> If(SelectedButton= "no" || IsBlank(SelectedButton), DisplayMode.Edit, DisplayMode.Disabled)
     
    Hope this Helps!
     
    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
  • mdevaney Profile Picture
    29,993 Moderator on at

    @Anonymous 

    Begin by placing this code in the OnVisible property of your screen.

     

    Set(buttonPressed, Blank())

     

    Next, put this code in the OnSelect property for each button. 

     

    Yes Button: Set(buttonPressed, "Yes")
    Neutral Button: Set(buttonPressed, "Neutral")
    No Button: Set(buttonPressed, "No")

     

    Finally, put this code in the Visible property for each button.

     

    Yes Button: buttonPressed="Yes" Or IsBlank(buttonPressed)
    Neutral Button: buttonPressed="Neutral" Or IsBlank(buttonPressed)
    No Button: buttonPressed="No" Or IsBlank(buttonPressed)

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @yashag2255 thank you this kind of works, however, when I have clicked the Yes button, the other two do disable.  But I can't seem to cancel.  How would I go about having a cancel button that clears the form to its previous state ?

     

     

    Screenshot 2020-01-19 at 18.16.16.png

  • mdevaney Profile Picture
    29,993 Moderator on at

    @Anonymous 

    You would put this code from the example of @yashag2255 into the OnSelect property of a Cancel button

    Set(SelectedButton,Blank())

     

  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @Anonymous 

     

    You can add a separate button for cancel and on the "OnSelect" property of the cancel button, use the expression: Set(SelectedButton,Blank())
     
    Hope this Helps!
     
    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

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
11manish Profile Picture

11manish 395 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 260 Most Valuable Professional

Last 30 days Overall leaderboard