fbpx

How to run Javascript from an action in Bubble

Follow me:

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.

Install the plugin

The Toolbox plugin in the Bubble plugin store

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.

Draw a button on the page

The Start/Edit workflow button in Bubble

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.

Create the Run Javascript action

Menu showing how to run Javascript from an action in Bubble

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 Plugins submenu.

Enter the Javascript to run in the Action step

Adding Javascript to a workflow step in Bubble

You can write or paste the Javascript directly into the action step itself, and it will trigger each time your button is clicked.

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.

Support the site and keep it free ❤️

I love tech startups and the Bubble community, and have made it my mission to try and create content that’s valuable, easy to follow and entertaining.

Creating content next to full-time consulting work is time-consuming; if you’d like to support it and keep the site free for everyone, please consider buying me a coffee or becoming a supporting member.

Buy Me A Coffee

Follow me:
Bubble.io books

Learn Bubble the right way

Our professional Bubble books teach you how to plan, structure and build your applications right from the start.

5-star review stars

More Posts

Leave A Reply

Your email address will not be published.

*

Email icon

Useful articles and tips

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

We don't share your email address with anyone, and you can unsubscribe at any time.

You have successfully subscribed