Element event properties

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

Learn more about experience levels.

Element events are events that are triggered by an element, such as when an element is clicked or its value changes.

An element is clicked

This event is triggered when the user clicks on the element. Most visual elements can trigger this event, including texts, buttons, images, and icons.

The an element is clicked event is only available in web apps. If you want to handle tap events in a native mobile app, see An element is tapped. For tap-and-hold events, see An element is pressed.

Element

Specifies which element triggers the event when clicked.

An element is pressed

This event is triggered when the user presses and holds and element. Most visual elements can trigger this event, including texts, buttons, images, and icons.

mobile

The an element is pressed event is only available in mobile apps. If you want to handle click events in a web app, see An element is clicked.

An element is tapped

This event is triggered when the user clicks on the element. Most visual elements can trigger this event, including texts, buttons, images, and icons.

mobile

The an element is tapped event is only available in mobile apps. If you want to handle click events in a web app, see An element is clicked. For tap-and-hold events on mobile, see An element is pressed.

An input's value is changed

This event is triggered when the value of an input changes. For text inputs, the event is triggered when the user removes focus from the input.

Element

Specifies which input form element triggers the event.

A map's marker is clicked

This event is triggered when the user clicks a map's marker. 'This map's current marker' refers to the marker the user clicked.

Properties

Element

Specifies which Map element triggers the event.

Data sources

This event introduces three data sources.

This map's current marker

Returns the marker currently selected by the user. The type of this data source is the type of content of map.

This map's center address

Returns the address at the center of the map’s current view.

This map's zoom level

Returns the current zoom level of the map as a number.

A popup is opened

This event is triggered when a popup opens through a Show an element/Toggle an element action or if an Animate an element action ends with showing the element.

Element

Specifies which popup element triggers the event.

A popup is closed

This event is triggered when a popup is closed through a Hide an element/Toggle an element action, if an Animate an element action ends with hiding the element, or when the user presses Esc.

Note on timing: An popup is considered closed as soon as the Hide this element action is executed, or the user presses the Esc button. However, popups fade out by default, and as a result the actions may run before the popup is actually hidden for the user.

In cases where you want to avoid this (such as when the result of the workflow may be visible on-screen while the popup is fading out), you can schedule a custom event to run in about 0.5 seconds. This gives the popup time to be completely hidden before the actions run.

Element

Specifies which popup element triggers the event.

An element has an error running a workflow

This event is triggered whenever Bubble reports an error in a workflow that was initiated by a specified element, such as a failed login attempt, as well as unexpected errors, such as the user being offline and Bubble being unable to communicate with the server.

This workflow takes priority over An unhandled error occurs.

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 alert 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.

Properties

Catch

The Catch property instructs Bubble to react to the following two error types:

  • Element workflow errors: If selected, Bubble will only react to errors that happen as a result of the user interacting with an element, such as clicking a button.

  • Any workflow error: If selected, Bubble will react to any error, regardless of the event of the workflow.

Data sources

This event introduces two new data sources.

Current workflow error code

Returns the error code of the error. 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.

  • 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.

Current workflow error message

Returns the error message. This allows you to display that message to the user.

To identify the error message:

  • Use the data source Current workflow error's 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.

Last updated

Was this helpful?