July 30, 2023

tForeach – Docs for ESB 7.x


Creates a loop on a list for an iterate link.

tForeach Standard properties

These properties are used to configure tForeach running in the Standard Job framework.

The Standard
tForeach component belongs to the Orchestration family.

The component in this framework is available in all Talend

Basic settings


Use the [+] button to add rows to
the Values table. Then click on the
fields to enter the list values to be iterated upon, between double
quotation marks.

Advanced settings

tStatCatcher Statistics

Select this check box to collect the log data at a component

Global Variables

Global Variables

ERROR_MESSAGE: the error message generated by the
component when an error occurs. This is an After variable and it returns a string. This
variable functions only if the Die on error check box is
cleared, if the component has this check box.

CURRENT_VALUE: the value currently iterated upon. This is
a Flow variable and it returns a string.

A Flow variable functions during the execution of a component while an After variable
functions after the execution of the component.

To fill up a field or expression with a variable, press Ctrl +
to access the variable list and choose the variable to use from it.

For further information about variables, see
Talend Studio

User Guide.


Usage rule

tForeach is an input component
and requires an Iterate link to connect it to another

Iterating on a list and retrieving the values

This scenario describes a two component Job in which a list is created and iterated upon in a
tForeach component. The values are then retrieved
in a tJava component.

Setting up the Job

  1. Drop a tForeach and a tJava component onto the design workspace.
  2. Link tForeach to tJava using a Row >

Configuring the components

  1. Double-click tForeach to open its
    Basic settings view:


  2. Click the [+] button to add as many rows
    to the Values list as required.
  3. Click on the Value fields to enter the
    list values, between double quotation marks.
  4. Double-click tJava to open its
    Basic settings view:


  5. Enter the following Java code in the Code area:

Saving and executing the Job

  1. Press Ctrl+S to save
    your Job.
  2. Press F6 to execute the

The tJava run view displays the list values
retrieved from tForeach, each one suffixed
with _out:


Document get from Talend https://help.talend.com
Thank you for watching.
Notify of
Inline Feedbacks
View all comments
Would love your thoughts, please comment.x