How can I setup a countdown that prevents a user from clicking a button until it runs out

Hello,

I’m building an application website and I’m trying to set up a system where once an admin denies an application on the backend from once that admin clicks the deny button a countdown starts for 14 days until the user can reapply again. Any help would be appreciated as I am new to Bubble.

Add a date field in your data type for “next allowed app”

When one is submitted set the field to current date time + 14 days

On button add a conditional for if current user “next allowed app” < current date time
button is clickable = no
Text = “apply again in (next allowed app - current date times formatted as days)

So I have this set when an admin clicks the deny button on the user’s app it makes this change
image
but when I try and set up the condition on the apply button I’m doing something wrong.
image

Next allowed app < current date and time.

No need to calc

Sorry I don’t know if you meant for me to change this or the condition for the apply button
This is what is in the workflow once an admin presses the deny button
image

You need the calculation there

Not on the conditional

I’m not able to add just the Next allowed app < current date and time for the condition on the apply button I did make a date field for Next allowed app but I don’t see it as an option when scrolling down the list in the condition section.
ezgif-4-0d384189433a

It’s a field on a User datatype. So you’ll need to select Current User’s - Next Allowed App > Current Date - element isn’t clickable

Do I selected the formatted as because I don’t see a current date option
image

No. Formatting will turn the date into a text.

You just need to set the Current User’s Next Allowed App (date) to be greater than, or less than, the current date (depending on whether you’re making the element clickable or unclickable).

So just select ‘<’ or ‘>’ (depending which way you’re working)

so now if the user’s next allowed date is less than 14 days it will stay unclickable? or is there something else I’m forgetting to do?

This event happens after an admin hits the deny application button
image

image
And I believe this has it set if the user’s next allowed app is less than 14 days than they can not click on it

It depends when you want the element to be clickable - before or after the next allowed app date.

But from your original post it sounds like you want the element to NOT be clickable until after the next allowed app (date).

In which case need to use: next allowed app > current date time - element isn’t clickable.

Or you can do it the other war round if the element isn’t clickable in the first place, then make it clickable if: next allowed app < current date time

I just first wanted to say thank you for helping me out like I said I’m still new to Bubble so sorry for any stress I may have caused dealing with me lol. I did have one more question so I have it set normally if you have already submitted an application it prevents you from clicking the apply button because I have a condition set if your app says yes than you can’t click on the apply button anymore is there anyway I can make it after 14 days it resets your app to say no you havent submitted one and they can resubmit an application?

No problem :slight_smile:

As for your second question, yes it’s simple…

Create a backend workflow that resets the datafield back to the original setting so they can resubmit an application.

Then, when you originally set the field so they can’t reapply (presumably when the application is submitted) just schedule the backend workflow that resets it to run in 14 days time (i.e. current date/time +14 days).

This is under once the deny button is pressed, but would this be correct it makes a change to the user changing their app to no only when their 14 days is up.

That will set the User’s ‘App’ field to ‘No’, but only if their next allowed app date is larger than the current date (i.e. in the future).

But if it’s not then nothing will happen. That’s just a conditional - it’s either true at the moment the workflow is run, or it’s not. It won’t wait until it is, or schedule anything for another time.

In order to do that you’ll need to schedule a backend workflow, from within the workflow where you set the field in the first place.