Timer before element can be clicked

So basically I am trying to make an action start a timer and make it so another element cant be clicked until that timer runs out… here is an example

So there is a Button Called “Suspend” when clicked I want it to start a countdown of 2 hours and then make it so the “Un Suspend” button can be clicked after the 2 hours the “Un Suspend” button can be clicked and used as normal


Maybe you can try this?

  1. Add field somewhere in your db for the suspended status, yes/no. default=no
  2. In your wf, add actions
  • change suspended status=yes
  • add pause before next action, 2 hours (in ms)
  • change suspended status=no
  1. Add in your other elements contains event: when susp status=yes, isn’clickable/disable etc

(to make it faster your can create cust state for this susp status on the page for this susp status, its state yes/no shall be set on your wf and when page loaded)

1 Like

@anwarsby you’re on the right track with the data, but unfortunately the “add a pause before next action” does not pause non-display workflows. Changing the database will happen almost instantly.

You can do what @anwarsby suggested but with a “schedule workflow action”. Unfortunately, that happens client-side, so if your user’s browser is closed or the connection is interrupted at any time in the 2 hours, it will not reset to no and will stay suspended indefinitely.

You can do date subtraction, unfortunately again, the current date/time does not automatically refresh client-side. So as long as your user doesn’t refresh the page, the button stays locked.

So you have two options:

  1. If you’re on any paid plan, you can Schedule an API workflow to reset the state to “no” with the correct date. That happens server-side so it will work regardless of whether or not your user closes or refreshes the browser.

  2. If you’re on a hobby plan, you can add a band-aid with a “do every x seconds” workflow that updates the current date time to a state, and use that state to do the date substraction. This will work but is heavy.

Here is an editor showing the four free functions. Schedule api workflow is only available on paid plans.

Ouh…thanks @duke.severn !

Okay wow thanks you both I will look into it and see what I can do

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