Hub
Pricing About
NodeNode / Manipulator

Variable Expressions (legacy)

KNIME Labs
Drag & drop
Like

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 .

Examples:

  • 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"
    "a2"

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

    a1 = "a1"
    a2 = "a2"
    a1

    will create a variable with the value "a1".

Node details

Input ports
  1. Type: Flow Variable
    Variables
    Input variables (optional).
Output ports
  1. Type: Flow Variable
    Output variables
    Output variables.

Extension

The Variable Expressions (legacy) node is part of this extension:

  1. Go to item

Related workflows & nodes

  1. Go to item
  2. Go to item
  3. Go to item

KNIME
Open for Innovation

KNIME AG
Talacker 50
8001 Zurich, Switzerland
  • Software
  • Getting started
  • Documentation
  • Courses + Certification
  • Solutions
  • KNIME Hub
  • KNIME Forum
  • Blog
  • Events
  • Partner
  • Developers
  • KNIME Home
  • Careers
  • Contact us
Download KNIME Analytics Platform Read more about KNIME Business Hub
© 2025 KNIME AG. All rights reserved.
  • Trademarks
  • Imprint
  • Privacy
  • Terms & Conditions
  • Data Processing Agreement
  • Credits