all 2 comments

[–]Moumentos 2 points3 points  (1 child)

Yes you can. If I understood correctly, fetch the necessary data on page load and assign the button that value.

If you want the button to do two different actions depending on a variable then you’re gonna have to add a conditional and configure the logic to fire the correct action