Putting limits on buttons

Hi,

does anyone know how to limit the amount of times a button can get pressed in row or during a specific amount of time?

You could setup a counter connected to pressing the button. Then have a condition on the button that says to make the button not clickable when the counter hits a certain number.

Something in that direction?

How do I setup a counter? And would it then be possible to lets say, reset the counter after 30 minutes?

something like this?

https://globerelocom.bubbleapps.io/version-test/buttoncounter?debug_mode=true

basically what you do is create a custom state on the button of a number. Something like ‘current.count’. Then the value of the state each time you click the button should be that buttons custom state + 1.

On the button you set a condition for the button to become not clickable after a certain number.

Oh and you can set a workflow to ‘do after 5 seconds’ (you can change the 5 to any number), to change the custom state of the button to 0

3 Likes

I couldn’t use the link, but I did what you said and created a custom state called current.count.
Then when a user clicks on the button I set the workflow to “set state current.count of button” with the value “this button’s current.count +1”

And I added a condition “when this button’s current.count is 1, this button isn’t clickable”.

I can’t figure out how to reset the current.count tho?

You create a workflow on whatever you want to reset it, and use the Element, Set State action choose the button, choose the state and set its value to 0.

1 Like

I managed to figure it out! I put unneccessary dynamic inputs that didn’t need to be there.
Thanks for your help!

1 Like

like so:

But it seems you got it. good!

This topic was automatically closed after 70 days. New replies are no longer allowed.