How to run Javascript from an action in Bubble

Time needed: 1 minute.

Even though Bubble itself is mostly built on Javascript, there’s no way to run a script from a workflow action. Luckily, it’s easy to get around it by using the brilliant Toolbox plugin.

  1. Install the plugin

    The first thing we need to do is to locate the Toolbox plugin in the Bubble plugin store. This plugin has been around for years, and offers numerous extremely useful elements and actions.

    The Toolbox plugin in the Bubble plugin store

  2. Draw a button on the page

    We’ll need something to trigger the Javascript action. For this we can use a simple button. Click on the button to see its properties, and then Click the Start/Edit workflow button in the element inspector.

    The Start/Edit workflow button in Bubble

  3. Create the action

    You’ll be taken into the Bubble workflow editor. Add an action in the button-click workflow, and search for Run Javascript or navigate to the plugin section:

    Menu showing how to add the action in the workflow editor

  4. Enter the Javascript

    You can write or paste the Javascript directly into the action step itself, and it will trigger each time your button is clicked.Easily adding Javascript to a workflow step in Bubble

Javascript is a pretty easy programming language and can greatly extend Bubble’s features, like copying text to the clipboard. If you’re not fluent in computerese, make sure to visit the Bubble forum, where you’ll always find someone happy to help out.

Share:

More Posts

Custom states VS URL parameters for navigation in Bubble

A lot of Bubble tutorials and guides describing page navigation default to using custom states for hiding and showing Groups. While states will work just fine in many cases, it has its limitations and shouldn’t be used simply because it’s

How to add keyboard shortcuts to your Bubble App

Keyboard shortcuts have been a natural part of desktop applications since… well, forever. For web applications it’s really in the last few years that they’ve started to become commonplace enough for users to actually remember to use them. Not to

Bubble vs WordPress – what’s the difference?

When people first hear about Bubble, they often quickly draw the comparison to WordPress. It’s not that far-fetched – after all, they’re both platforms that allow non-coders to set up a website, create content and publish it for the world

How to do complex calculations in Bubble

The Bubble expression editor – you know… this one: … is pretty good! But if you’re trying to do more complex mathematical expressions, you’ll find that the built-in editor has its limits. You can easily set up basic arithmetic like

Leave A Reply

Your email address will not be published. Required fields are marked *

*

Useful articles and tips

Useful articles and tips

Join the mailing list to get guides, opinions and articles on Bubble, no-code, automation and the tech industry.

You have Successfully Subscribed!

Share This