Schedule Customer Event vs Trigger Custom Event

Hello,

Anyone have an opinion on:

  1. What’s the difference? > From my experience the trigger custom events triggers immediately while the schedule custom event doesn’t but

  2. When do you use the tigger vs the scheduled?

Interested in the community tips.

Thanks

1 Like

TL:DR: Scheduling a custom event schedules it to run in the future. For instance, if I wanted to trigger one not now but in 45 seconds, I can schedule it to 45 seconds from now (I forget if you must specify the time in ms or in s, but the concept is the same).

Discussion:
It have not used it myself because it has two limitations. The first thing is if the user refreshed the page or changes page it obviously cancels the event because this is something happening on the client side. However, in cases where that didn’t matter, I had to rely on a plugin I created instead of using this action. The reason is because often times when we are scheduling things on the client side, we are doing so because we want something to happen more than once. Bubble automatically detects if a custom event schedules itself, I.E you are looping through the same action every X seconds. It doesn’t want us to do that, unfortunately.

Well…

You’d use ‘Trigger’ when you want it to trigger immediately.

You’d use Schedule when you don’t want it to trigger immediately (e.g. to show a popup 5 seconds after the page loads).

Also, you can’t create recursive loops using ‘Trigger’ but you can with ‘Schedule’.

1 Like

Have you posted the plugin to the plugin marketplace. Interested to see what if it works as I suspect, which is to keep the ‘timing’ of the scheduled action to run even if the user refreshes the page or navigates to a new page within the app.

I use the trigger event when i need the workflow to run now. I’ve been using the schedule event to send notofications after the fact or to delete a confirmation code after a set amount of time.

1 Like

I use scheduling of event for enabling and disabling buttons. So, the moment a button is clicked, ideally it should become disabled immediately instead of allowing multiple quick clicks. Bubble doesn’t support it by default. So, I set a custom state that disables the button and schedule an event to enable it after few seconds.

Another good use case would be in showing Toast messages for deleting or some actions that can be undone. So for example as it happens in Gmail, if you delete some item, you can show a toast message that it has been deleted and ask user to undo. In this case you can schedule custom event to do actual deletion only after x seconds and give some time to user to undo. If user does undo, then you can cancel the trigger (don’t know if it is directly supported. If not, then can be done via some custom state manipulation).

Yeah, it’s my “Wait Please” plugin. You have to use the “Client side wait” and the “Wait has finished” action to be able to loop things. I use this on my better uploader plugin page, since I don’t want to fill the database, every time someone visits the page I initiate the loop and it deletes previously uploaded files (by other visitors) one at a time. Saves me money on bubble fees, haha

Really? Every time I’ve tried it console logged an error and stopped the WF. I wonder if maybe I wasn’t doing it right or something changed. Must admit it has been a long time since I tried using schedule.

Nice, I just checked it out. Any possibility that it could be configured to work if the user initiates the wait and then refreshes the page for the action to still track the ‘time to wait’ and will execute the actions. For example, if I put a wait of 30 seconds and I refresh the page or I navigate to another page, would it keep track of the time and still execute.

Once the user refreshes the page, all scripts on the page stop. You can’t control that, that’s just how browsers work. You could probably get creative with making changes to the database to track that but I don’t think it’s really viable

1 Like

I would also like to add that having a triggered event within a flow has been problematic, because it doesn’t “force the order” (it just runs)… You risk data not being passed if you have a custom event in the workflow… just an FYI…

Generally, if I have more than one action in a workflow = scheduled
If the actions are few and limited with no dependancies = trigger

Thanks everyone