0 ×

Variable Expressions

KNIME Expression Nodes version 4.3.0.v202011191431 by KNIME AG, Zurich, Switzerland

This node provides the possibility to append an arbitrary number of flow variables or modify existing variables using expressions. For each variable that shall be appended or modified a separate expression is defined. These expressions can be simply created using predefined functions similar to the Math Formula and String Manipulation Nodes). Nevertheless there is no restriction on the number of lines an expression has and the number of functions it uses. This allows users to create their own complex expressions.
Additionally, intermediate results of functions or calculations can be stored within an expression by assigning them to variables (using '='). This allows that these results can be reused in different parts of the expression after they have been assigned (see Examples). Note: the names of these variables must be different to all of the predefined function identifiers. Otherwise an error will occur.
To change an expression of an output variable it has to be selected in the list of expressions. By selecting an expression the Expression Editor shows up and the user can modify the expression in the provided text area.
Available flow variables can be accessed via the provided method variable("varName"). For each expression the last computed instruction will be returned.

The syntax and grammar of the expressions are based on the Javascript Languange .


  • 5*7+3

    will append a variable with the value 38.

  • v = variable("knime.workspace")
    substr(v, lastIndexOfChar(v,"/"), length(v))

    will create a variable containing the folder name of the KNIME workspace folder.

  • "a1"

    will create a variable with the value "a2", whereas

    a1 = "a1"
    a2 = "a2"

    will create a variable with the value "a1".



Adds a new output variable.
Removes the selected output variable.

Expression Table

Shows the currently defined expression for the specified output variable.
Shows the defined type that shall be returned by the script. The resulting variable will have this type in the output table.
Replace Variable
If checked the defined output variable will be replaced. If unchecked the output variable will be appended.
Output Variable
The name of the output variable.

Expression Editor

This opens a list containing all available flow variables. The selected flow variable can be inserted by hitting ENTER or by double clicking it. This menu can be also accessed via the shortcut 'ALT + v' (Windows & Linux) or via 'CTRL + OPTION + v' (Mac) and closed with 'ESC'.
This opens a list containing all available predefined functions together with their description. The selected function can be inserted by hitting ENTER or by double clicking it. This menu can be also accessed via the shortcut 'ALT + f' (Windows & Linux) or via 'CTRL + OPTION + f' (Mac) and closed with 'ESC'.
By clicking on this button the current expression will be evaluated and the result will be shown.

Input Ports

Input variables (optional).

Output Ports

Output variables.

Best Friends (Incoming)

Best Friends (Outgoing)



To use this node in KNIME, install KNIME Expressions from the following update site:


A zipped version of the software site can be downloaded here.

You don't know what to do with this link? Read our NodePit Product and Node Installation Guide that explains you in detail how to install nodes to your KNIME Analytics Platform.

Wait a sec! You want to explore and install nodes even faster? We highly recommend our NodePit for KNIME extension for your KNIME Analytics Platform. Browse NodePit from within KNIME, install nodes with just one click and share your workflows with NodePit Space.


You want to see the source code for this node? Click the following button and we’ll use our super-powers to find it for you.