Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

When I press one button of the two buttons, disable both the buttons.

Hey @nickduxfield 


I think you can help me solve my issue regarding disabling buttons.

I have a screen which has 2 buttons:

AcceptButton and RejectButton [I have attached the scrren below]

When the customer is using this screen,

eg: If he clicks on AcceptButton the first time,the AcceptButton and RejectButton should be disabled and in the same case if he clicks on RejectButton the first time, the rejectbtton and acceptbutton should be disabled... he can only go back by presseing GO BACK button below.


Please help!

Thank you.button.PNG

Not applicable

In the OnSelect property for your Accept and Reject buttons use an UpdateContext to set a variable to true, use the same variable for both buttons. 


UpdateContext({buttons_off: true})


Then in the OnSelect property for your GOBACK button add:


UpdateContext({buttons_off: false})


Now set your DisplayMode property  in both your accept and reject buttons to use the variable, buttons_off.

If(buttons_off, DisplayMode.View, DisplayMode.Edit)

Hey thanks for the reply:


As you instructed:


on select property: I have done the same thing for reject button as well.


Go back button on select property: 


Im getting an error in Displaymode:



What do I need to do?



Not applicable

Each button has it's own OnSelect. Do it like this:

For Accept button OnSelect



UpdateContext({buttons_off: true});

Patch(Your patch commands....



Then do the same for your Reject button's OnSelect.


Thenfor your Go Back button OnSelect:



UpdateContext({buttons_off: false});

Navigate(LoginScreen, Fade)



Now, for your Accept button's DisplayMode:



If(buttons_off, DisplayMode.View, DisplayMode.Edit)



Do the same for your Reject button.


That should do it. Your syntax with UpDate({AcceptButton: false, RejectButton: False...... is very wrong. That's where the errors are coming from. 

Responsive Resident
Responsive Resident

If he clicks on AcceptButton the first time

in addition to your action to your database to confirm accept/reject you need to add this to the button properties. 

AcceptButton.onselect =


,the AcceptButton and RejectButton should be disabled and in the same case

AcceptButton & RejectButton .visibility field set to the contect variable varActionButton 
When any button is selected it toggles variable between true false.
The .visibility field toggles visibility using true/false.

he can only go back by pressing GO BACK button below. (back meaning unlock buttons, not navigation)




Go back can unlock the accept/reject controls allowing another choice, and when unlocked,

could double as a navigate away to another screen. based on a safety dialogue box with a 

'are you sure you want to go back?'

GoBack Button

/*If pressed while action buttons visible, it means go back*/
/*If pressed while action buttons are hidden, they become visible and active.

Dialogue box YES Button





I trust you understand the concept,

further questions can be asked



Helpful resources

Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,548)