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

Disable buttons when another button is clicked.

(0) ShareShare
ReportReport
Posted on by 195

I would like to disable the 'Reject', 'Cancel' and 'Request Change' buttons when the 'Approve' button is clicked.  I thougth the below formula would work, but it didn't.

isogunro1_0-1679340256567.png

 

Categories:
I have the same question (0)
  • TheRobRush Profile Picture
    11,128 Moderator on at

    give all the non approve buttons this displaymode

    Switch(chosenBtn=btnApprove,
     true, DisplayMode.Disabled, DisplayMode.Edit)

     

    and add this to the approve buttons onselect

    UpdateContext({chosenBtn:Self})
  • isogunro1 Profile Picture
    195 on at

    @TheRobRush ,

     

    What does this do?  

    UpdateContext({chosenBtn:Self})

    I'm confused by the 'Self' 

  • isogunro1 Profile Picture
    195 on at

    @TheRobRush ,

     

    Also, how do I enable those buttons again once I navigate away from the page?  When I go to the same page with a different item, those buttons are still disabled.

  • Verified answer
    TheRobRush Profile Picture
    11,128 Moderator on at
    UpdateContext({chosenBtn:Self})

    Tells your aapp.via context that the submit button has been selected.

     

    To reset, in the onvisible.of that screen place 

    UpdateContext({chosenBtn:Blank()})
  • isogunro1 Profile Picture
    195 on at

    @TheRobRush , thanks for responding but I get the following error

    isogunro1_0-1679412761535.png

     

  • TheRobRush Profile Picture
    11,128 Moderator on at

    hover arond the squiggly lines back and forth until it shows you the actual error, or hover over the red x on the screen. righ tnow you are not showing the error, jsut the definition of updatecontext

  • TheRobRush Profile Picture
    11,128 Moderator on at

    Oh Nevermind I see recreated iton my side, give me one minute

  • TheRobRush Profile Picture
    11,128 Moderator on at

    So change it from blank to ANY name of one of those other buttons doesn't matter which just choose one

  • TheRobRush Profile Picture
    11,128 Moderator on at

    like so

    UpdateContext({chosenBtn:btnReject})
  • isogunro1 Profile Picture
    195 on at

    Thank you @TheRobRush 

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 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard