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

Enable/Disable buttons on select

(0) ShareShare
ReportReport
Posted on by

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:
I have the same question (0)
  • 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,989 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
    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,989 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

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 765 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 272

Last 30 days Overall leaderboard