General event properties

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

Learn more about experience levels.

General events are triggered upon specific conditions not necessarily initiated by the user interacting with an element, such as when the page loads, a user logs in/out or a specific condition is true.

General events are triggered upon specific conditions not necessarily initiated by the user interacting with an element, such as when the page loads, a user logs in/out or a specific condition is true.

An unhandled error occurs

This event is triggered whenever Bubble reports an error 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 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

Any workflow error

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

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.

Data sources

Code: returns 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 condition on the event or action that includes the error code.

Using the error code

  • Use the data source 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 static.

Message: returns 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 conditions.

Using 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 static.

Do every 5 seconds

This event performs an action at a fixed interval that you set.

Interval (seconds)

Enter the interval in seconds to define how often the event runs. Decimal values are supported and must use a dot . rather than a comma ,.

Do when condition is true

Description

This event is triggered as soon as its condition 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.

Page is loaded

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

User is logged in

This event is triggered when the current user logs in. Specifically:

User is logged out

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

  • On page load, if the user is not logged in

  • When the Log the user out action is successfully completed

Last updated

Was this helpful?