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

View solution in original post

lolla70
Helper IV
Helper IV

Thank you so much. That was easy.

glad it worked

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,179)