I currently have an event that makes changes to current user. It currently runs after page load. However, I want to add a 5-10 second delay after the page loads.
How could I do this?
P.S. Bubble has a feature “add pause before next action” but that only delays front-end things like popups. It doesnt delay changes to the database.
The way to do this with delaying anything on the front-end is as follows:
- Add the actions you want delayed to a custom event
- Then, set a workflow to run on page load and have it run an action to “schedule a custom event” and set it to run with a delay of 5 or 10 seconds.
I figured it out. This is how I did it. This works if you’re trying to add a time delay on anything that runs in the back-end (database entries, API’s, etc). My goal in here was to ask to make a change to the current user 10 seconds after the page had finished loading. I create this time delay by changing a custom event’s value 10 seconds after page load. I then have another workflow that only runs if the custom event changes.
-
Go to the page and set a custom state to the page. In my case, I gave my home page a custom state called “asklocation”. Make the custom state of type yes/no. Make default value = no (false)
-
Add the following workflow: When this page is loaded --> Add a pause before next action --> set custom state: element = homepage; custom state = asklocation; value = yes
-
Now create another workflow. It goes like this: Do when condition is true: this page’s “asklocation” = yes --> make changes to current user or create a new thing. here’s where you insert the event you want delayed.
Why not just schedule a custom event for 10 seconds from now? That seems much simpler.
I just wasn’t familiar with scheduled custom events. Your proposed solution seems like it would work too.
Was just curious. Thanks.