General events

Events that are triggered upon specific conditions not necessarily initiated by the user interacting with an element.

This core reference entry is suited for beginner-level builders.

User is logged in

Watch this video to learn more about the User is Logged In Event

This event is triggered when the current user . This event is triggered:

User is logged out

Watch this video to learn more about the User is Logged Out Event

This event is triggered when the current user logs out. This event is triggered:

Page is loaded

Our Academy quick tip on how to create an event on page load

This event is triggered when:

  • The page is loaded

  • The Go to page action is completed, even if the user stays on the same page

Note the last point; the Go to page action will trigger this event regardless of whether a new page was loaded. You can avoid this by using a , such as saving and then a the first time the page loads to avoid triggering the event repeatedly.

Do every X seconds

Watch this video to learn more about the Do Every X Seconds Event

This event performs an action every X seconds. Bubble updates in real time, so this event will not be used often.

Interval

Enter a number in seconds to define the interval.

Note on performance and workload: Running an operation at frequent intervals can quickly have a negative effect on your app's performance. It's best to use this feature with caution so that you don't overload the server or user's device. Be mindful of what kind of actions you are running, and don't repeat them more frequently than you need to. Repeated database operations in particular can consume a lot of .

Do when condition is true

Watch this video to learn more about the Do When Condition Is True Event

This event is triggered as soon as its is true.

Run this...

  • Only once: the event will trigger only once per page load. The Go to page action does not reset this option if the user remains on the same page – it will still only run once.

  • Every time: the event is triggered every time the condition is true.

Note that the Do When Condition is True event can lead to performance issues if it is triggered too frequently. It's best to use this feature with caution so that you don't overload the server or user's device. Be mindful of what kind condition you are placing on the event and what kind of actions are executed when the condition is true to maintain a stable level of capacity usage.

An unhandled error occurs

Watch this video to learn more about the Unhandled Error Occurs Event

This event is triggered whenever Bubble reports an in a workflow. This will execute if the error happens anywhere on the page and happens for both expected errors, such as a failed login attempt, and unexpected errors, such as a bug with the Bubble platform.

The An element has an error running a workflow event will take priority over this workflow. In other words, if both events are potentially triggered, only the The An element has an error running a workflow event will run.

The default handling of errors in a Bubble app is to automatically display the error to the user using the browser's default messaging system.

For workflows handling unexpected errors, it's advised not to fetch data from the database or external APIs. This is because network or connectivity issues, which might cause the initial error, could also make the error workflow itself fail. This happens if the workflow depends on data that cannot be accessed due to these issues. In such cases, users might end up seeing an error alert if the error workflow doesn't execute successfully.

Catch

The catch setting lets you specify what type of errors the event will be triggered by.

Any workflow error

This will trigger the event regardless of which workflow caused the error.

If you place the An unhandled error occurs event on a page and sets catch to Any workflow error, Bubble will stop displaying workflow error messages altogether. This is useful if you want to set up your own system for displaying or silencing errors, but it can also stop you and/or the user to from seeing necessary/useful error messages.

Element workflow errors only

This will trigger the event only when the workflow is initiated by an element, such as a button being clicked or an input form element's value changing.

This applies to all elements on the same page. If you want to set up an error workflow on a specific element, use An element has an error running a workflow instead.

Identifying the error code

Each error in Bubble has a unique code. If you want to set up the workflow to react to a specific error, you can define this using a on the event or action that includes the error code:

To identify the error code:

  • Use the Current workflow error's code

  • You can find the list of all error codes in Settings - Language and scrolling to the bottom of the language text strings.

  • Error codes are .

Returning the error message

In the same way as above, you can also return the error message Bubble would normally display. You can combine the code and the message to manage all errors in the same way, or identify specific errors by using .

To identify the error message:

  • You can find the list of all error messages in Settings - Language and scrolling to the bottom of the language text strings. They can be customized as you see fit.

  • Error codes are not .

Last updated