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
Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

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.

<
Users online (2,561)