Docs Examples FAQ Discussion Thanks

Run Javascript

Expression

Javascript to Bubble

List of Numbers

List Item Expression

Server Script


Examples

FAQ


News

Version history

News

2023-Jul-28

Javascript to Bubble multiple outputs

Enabling this allows sending multiple data types to Bubble. For example, set output1 type to text and output2 type to number:

bubble_fn_fruit_count({output1: "apple", output2: 69});

More details in javascript to bubble.


2023-Jul-23

Breaking change! Upgrade to plugin api v4

Toolbox upgrade to Bubble's v4 of plugin API. This potentially affects every use of Server script.

When to update

If your app uses Server script, it will need to update by March 12, 2024.

Bubble announcement and timing

What to change

This link details all the V4 plugin api changes:

Bubble update guide

  • Getting data no longer uses Fibers, instead it returns a promise that needs to be resolved with either a then function, or an await instruction.

  • Some Bubble-provided functions have been renamed

  • Fetch is now a global function

Async function vs eval block

As part of the upgrade, there is a new option to treat the script as the body of an async function, enabling await and requiring an explicit return.

If left disabled, the script is evaluated as a block, and the last statement determines the returned value.

Ignore error

Wraps the script in a try/catch, and ignores or logs the errors.

Multiple outputs

Enabling this allows returning multiple data types.

Discussion and examples

Discussion here.

More details and examples are in server script.


2023-Jul-11

Javascript to Bubble queue

Having a disconnect between events and values has always bugged me a little. Now with the introduction of a queue, events are delayed until the app is ready to retrieve the value.

More details in javascript to bubble.


2023-Jun-27

Run Javascript: added parameters

Allows input of Bubble data types in Javascript.

More details in run javascript.