return clause returning either a value or null / undefined.
The script has access to a row object that represent a row in the dataset and have the column names as keys.
Lists are supported both as inputs and outputs.
It’s important to correctly manage null values by checking for null (e.g. if (row.col != null) { ... }) or using the JS optional chaining operator (?).
Usage
The following examples show how the step can be used in a recipe.Examples
Examples
- Example 1
- Example 2
- Example 3
- Example 4
- Example 5
- Example 6
- Signature
The following example joins all values in a list of numbers with ’|’ as separator:
Inputs & Outputs
The following are the inputs expected by the step and the outputs it produces. These are generally columns (ds.first_name), datasets (ds or ds[["first_name", "last_name"]]) or models (referenced
by name e.g. "churn-clf").
Configuration
The following parameters can be used to configure the behaviour of the step by including them in a json object as the last “input” to the step, i.e.step(..., {"param": "value", ...}) -> (output).
Parameters
Parameters
The javascript code to execute.
Examples
Examples
- For example, to multiply by 2 every row with a value: