Custom actions

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

Learn more about experience levels.

This core reference entry covers how to trigger, schedule, and cancel custom events. For more information on how to create custom events, see the entries below.

Reference: Events | Custom events

Return data

This action passes a return value back to the workflow that triggered the custom event. When Bubble encounters a valid Return data action, the workflow stops and returns the value immediately.

If the custom event's return value isn't optional, at least one Return data action without a condition is required.

Return value

The value to return. Must match the type defined for the return value on the custom event. The returned value is accessible in other workflows as the result of that custom event.

Schedule a custom event

This action runs a custom event at a set time in the future. If the user leaves the page before the scheduled time, the workflow won't run. Unlike Trigger a custom event, workflows run by this action run independently from — and possibly in parallel with — the workflow that initiated it.

Custom event

The custom event to schedule.

Workflow parameters

The parameters defined at the custom event level.

Delay

The number of seconds to wait before running the custom event. Fractional values are accepted.

Set/cancel a recurring event

This action schedules or cancels a recurring workflow on a thing. Only one recurring event can be active per database thing at a time. Setting the frequency to None cancels the recurring event.

Recurring event

The recurring event to schedule or cancel. These are defined in the Backend workflows page, found in the application menu above the palette.

Workflow thing

The thing to attach the recurring workflow to. Must be the same type as the recurring event.

Frequency

How often the workflow runs. Choose from None, Weekly, Monthly, Quarterly, and Yearly. Setting this to None cancels the recurring event.

Start date

The date to start the recurring event. If the action is run on a thing that's already scheduled, the start date must be after the original next run date — otherwise it will be pushed back by one period.

Trigger a custom event

This action triggers a custom event defined on the current page. Custom events are a way to share workflows and actions across the different workflows on a page.

Custom event

The custom event to trigger.

Workflow parameters

The parameters defined at the custom event level.

Trigger a custom event from a reusable element

This action triggers a custom event that belongs to a reusable element. Defining custom events in a reusable element lets you build a shared library of workflows that can be used across pages and reusable elements in your app.

Reusable element

The reusable element whose custom event you want to trigger.

Custom event

The custom event to trigger. Only custom events from the selected reusable element are shown.

Workflow parameters

The parameters defined at the custom event level.

Trigger a custom event when data changes

This action watches a specific field on a thing and triggers a custom event once when that field changes. The custom event must have a parameter that matches the type of thing being watched — the thing is passed to the custom event when it runs.

Keep in mind that the event only triggers while the page remains open, and must be called again if the page is closed or reloaded. It also only triggers once per call of this action.

Custom event

The custom event to trigger when the field changes.

Parameter

The thing to watch. Must match the type of the custom event's parameter.

Field

The field to watch for changes. If the value of this field changes, the custom event is triggered.

Last updated

Was this helpful?