cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
lolla70
Helper IV
Helper IV

Disable a button after Patching the Submit button

I have a button named "Buy Stock" that take me to another page to answer some questions, once it is answered they click the Submit button. I want when they submit the button to Disable the "Buy Stock" so they can't go back and click again to answer again.

 

On the Start APP: 

Set(
varBuyingStocks,
!IsBlank(
LookUp(BuyingStocks,
EmployeeEmail=VarUserEmail
)
)
);

 

On The Buy Stocks Button - Display Mode

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

 

And on the Submit Button I added

Set(
varBuyingStocks,
true
);

 

Once I click on it it works great for the first time and disabled the button. However, we I delete the info from the SharePoint and refresh the connecter from PowerApps, the button suppose to be enabled cause there is no data. However the button still be disabled. What I am doing wrong?  Thanks in advance for your help

1 ACCEPTED SOLUTION

Accepted Solutions
zmansuri
Super User
Super User

You refresh the data source but your variable is on App.OnStart so in play mode you need to reopen the app and in edit mode you need to click "Run On Start" to initiate the variable

View solution in original post

3 REPLIES 3
zmansuri
Super User
Super User

You refresh the data source but your variable is on App.OnStart so in play mode you need to reopen the app and in edit mode you need to click "Run On Start" to initiate the variable

lolla70
Helper IV
Helper IV

Thank you so much. That was easy.

glad it worked

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Top Solution Authors
Users online (3,056)