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
async function (source: unknown) => Promise<void>;
Parameter name | Description |
---|---|
source | The text to display on-screen. Non-string types are converted to strings. |
Displays the given text on-screen.
output.text('Hello, world!');
Outputs:
Hello, world!
markdown Scripting Extension only
async function (source: string) => Promise<void>;
Parameter name | Description |
---|---|
source | The Markdown to display on-screen. |
Displays the given Markdown on-screen.
output.markdown('Hello, *world*!');
Outputs:
Hello, world!
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
async function (data: unknown) => Promise<void>;
Parameter name | Description |
---|---|
data | The array or object to display on-screen. |
Outputs arrays or objects as tables. It mirrors the console.table API.
output.table(['hello', 'world']);
Outputs:
Values | |
---|---|
0 | hello |
1 | world |
output.table([{name: 'Guthrie', age: 5, type: 'cat'},{name: 'Amber', age: 4, type: 'dog'},]);
Outputs:
name | age | type | |
---|---|---|---|
1 | Guthrie | 5 | cat |
2 | Ambder | 4 | dog |
inspect Scripting Extension only
async function (object: unknown) => Promise<void>;
Parameter name | Description |
---|---|
object | The 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
async function () => Promise<void>;
Clears all previous output.
set Automations only
function (key: string, value: unknown) => void;
Parameter name | Description |
---|---|
key | The key to set in the output object. |
value | The 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.
output.set('foo', 42);