openBuild
  • Introduction
    • Introduction
    • The Framework
    • The Library
    • Release Notes
  • Core Concepts
    • Bubble vs openBuild
    • Responsive Design
      • Repeating groups
      • Advanced Responsiveness
    • Styles
      • Typography
      • Colors
      • Groups & Box Shadow
      • Inputs
      • Buttons
      • Style Variations
      • Changing styles
      • Custom CSS
    • Pages
      • index
      • base-menu
      • base-top
      • base-ribbon
      • base-mobile
      • admin
      • verify
      • styleguide
      • terms
      • login
      • reset_pw
      • privacy
      • 404
      • Menu
      • Base Layouts
  • WORKING WITH the framework
    • Getting Started
    • Navigation
      • Go to page
      • Navigation through custom states
      • Navigation through URL parameters
      • Navigation through URL parameters with Option sets
    • Data & Workflows
      • Custom States
      • Custom Events
      • Working with Reusables
      • CRUD
      • Source Popup
      • Backend Workflows
    • Users and Roles
    • Signup, Login, Password reset
    • Security & Privacy
      • Authenticating endpoints
    • Transactional Email
      • Setup Sendgrid
      • Setup Postmark
    • Alerts and Confirmations
    • Customization
    • Best Practices
      • Syntax
      • Color Coding
  • openBuild Library
    • Chrome Extension
  • Framework Elements
    • Menus
    • Option sets
    • Plugins
    • API Connector
    • User Access Management
    • CRUD Floating Group
    • CRUD Popup
    • Data Table
    • Security Redirect
    • Mail management
    • User Settings
    • Header & Footer
Powered by GitBook
On this page
  1. WORKING WITH the framework
  2. Data & Workflows

Custom Events

PreviousCustom StatesNextWorking with Reusables

Last updated 2 years ago

From the Bubble manual:

Custom events are a way to define a workflow in your page that can be reused multiple times ("functions" in a code-driven language).

You will find multiple uses of custom events in the template.

Reusable elements can be used as sections with UI's or just workflows (no UI). A great use case for creating reusable with only workflows in it is for example integrating payments in your app. Workflows created in one place could be then reused on multiple pages throughout your app.

We are heavy proponents of Custom events as we try to avoid duplicate work as much as we can. Custom events are a great tool to keep your workflows lean, your debugging time short and your teammates happy.

Workflow execution rules

Bubble actions do NOT run sequentially. Most of the time actions will not be completed in the same order as they are triggered.

In the example below you cannot be sure that every time you run this workflow step 3 will be executed after step 1 and step 5 will always be before step 2 etc. The execution order is dependent on the type of action of client-side criteria (e.g. the newly created object needs to be displayed immediately on the page etc.)

There are two ways you can force Bubble to run your actions sequentially:

a) Use 'Result from Step X' in your conditional logic. For example 'Result of step 1 unique id is not empty'

b) use Custom Events. In the example below Bubble will first trigger Custom Event A meaning all actions inside the Custom Event will be run before triggering Custom Event B.

When a workflow is triggered in Run-mode and hits a trigger a custom event action, the first workflow will pause, the custom event will be run till completion, and the first workflow will resume. Using the debugger can be very helpful to understand the flow of actions if you are hitting some difficulties setting things up

Learn more about order of execution from this Bubble video:

Read more about the basics of Custom events in .

Advanced practices of using Custom events are based on the connection between Custom events and Reusable elements (you can read about the basics of Reusable elements in )

Read how we use custom events and reusable elements together .

From :

Bubble manual
Bubble manual
in this section
Bubble manual
Dedicated custom events for sending emails. You will find these in 👥 USER ACCESS MANAGEMENT reusable.
Example