Scripting
output

output

Your scripting extension can output rich information to show your users what's happening while your script runs, or to display custom analysis of the data in your base. Output is done through the built-in output object.

Your scripting automation action can output data. Output is done through the built-in output object. Data that you output will be available to subsequent automation steps within the template expression UI. Click on the blue '+' icon or type '{' and select the output key that you would like to use.

text
Scripting Extension only

function
async function (source: unknown) => Promise<void>;
Parameter nameDescription
sourceThe text to display on-screen. Non-string types are converted to strings.

Displays the given text on-screen.

Example
output.text('Hello, world!');

Outputs:

Hello, world!

markdown
Scripting Extension only

function
async function (source: string) => Promise<void>;
Parameter nameDescription
sourceThe Markdown to display on-screen.

Displays the given Markdown on-screen.

Example
output.markdown('Hello, *world*!');

Outputs:

Hello, world!

Example
output.markdown(`
**Base name**
The name of the current base is '${base.name}'.
`);

Outputs:

Base name

The name of the current base is 'Projects'.

table
Scripting Extension only

function
async function (data: unknown) => Promise<void>;
Parameter nameDescription
dataThe array or object to display on-screen.

Outputs arrays or objects as tables. It mirrors the console.table API.

Example
output.table(['hello', 'world']);

Outputs:

Values
0hello
1world
Example
output.table([
{name: 'Guthrie', age: 5, type: 'cat'},
{name: 'Amber', age: 4, type: 'dog'},
]);

Outputs:

nameagetype
1Guthrie5cat
2Ambder4dog

inspect
Scripting Extension only

function
async function (object: unknown) => Promise<void>;
Parameter nameDescription
objectThe object to inspect.

Takes any data from your program and outputs an interactive inspector for exploring it. This is useful for debugging your script as you write it.

clear
Scripting Extension only

function
async function () => Promise<void>;

Clears all previous output.

set
Automations only

function
function (key: string, value: unknown) => void;
Parameter nameDescription
keyThe key to set in the output object.
valueThe value to set for the given key (must be JSON-serializable).

Sets a property in the object output by the script. If a value was already set for the given key, it will be overwritten with the new value.

Example
output.set('foo', 42);