[Feature update] Global expressions are out of beta

Hi everyone,

I’m Lindsay, a product manager here at Bubble.

When we released global expressions in beta, the response from this community made one thing clear: You’d been waiting for a way to stop copy-pasting the same logic all over your apps. Today I’m happy to share that we’ve moved global expressions to GA, and it’s picked up some of your most requested updates along the way.

A quick refresher

Global expressions are reusable dynamic expressions. You build an expression once in the Global tab, give it a name, and use it anywhere in your app, including elements, workflows, and backend workflows. Edit it in one place and the change cascades everywhere it’s used. You can also add parameters to tailor a global expression at each place you use it.

What’s new in GA

Since the beta launch, we’ve been building alongside your feedback. Here’s what’s new:

  • Folders and sorting: Organize your global expressions into collapsible folders as your library grows, and sort them alphabetically or by creation date.
  • Optional parameters with default values: Mark a parameter as optional and give it a default to fall back on, so one global expression can flex across more use cases
  • Descriptions: Add a description to any global expression or parameter. Hover to see it, or view it when selecting a global expression on the design tab

How to get started

One thing to note: You’ll need the new property editor enabled to create and edit global expressions. If you haven’t yet, toggle it on at the top of the property editor.

From there:

  1. Head to the Global tab in the editor (it’s where the Styles tab used to live) and open the Global expressions subtab.
  2. Create a new global expression: Give it a name, description, return type, and any parameters it needs, then build the expression itself.
  3. Use it anywhere in your app by selecting the Use global expression operator and filling in the parameter values.

To set up a global expression from existing logic, right-click any existing expression to convert it, then audit your app and replace old expressions accordingly. You can also check where any global expression is being used from the app search tool, which makes cleanup and refactoring more straightforward.

Give it a try and let us know what you build. And if you’d like to explore some clever use cases, check out this post by Petter Amlie.

Happy building!

— Lindsay

Nice, this is the best Bubble feature since reusable element properties/custom event parameters!

Awesome job! It’s one of the features that opens up a lot of possibilities.

great one :100:

Looks quite interesting. I just tried to use it but it asked me to use new editor. Is it possible that we can use them somehow in old editor?

I am not able to use new editor due to low contrast. Can’t read properly. Old editor has black, yellow, red, blue, white, gray colours. New editor has just white, black, grey (that too quite light).

You can use global expressions in the old editor, but you can’t create new ones. It’s a hassle, but as of now, it’s the only way.

I sent this comment to the team’s internal feedback board