2021.2

Table Of Contents
on selected nodes, you need to edit the Xpath/JsonPath in the Collection field (see
below). If the path defines a rule that is true for more then one node/element, a
collection of nodes/elements is returned and the For Each loop will go through all of
them.
Note
When using a For Each loop in XML or JSON, it is not necessary to skip to
the repeating node/element or to have a Goto step to jump to each sibling, as
this loop takes care of it automatically.
l Maximum iterations on each line: Defines the maximum number of iterations occurring
at the same position. This expression is evaluated once when entering the loop. The
value returned by the expression must be an integer higher than 0.
Note that in the event of an infinite loop, an error will only be raised after the set maximum
number of iterations.
l Use JavaScript Editor: Click to display the Edit Script dialog.
l No Goto step required: With XML and JSON data, this option prevents the Repeat step
from automatically moving forward to the next sibling (with XML) or element (with JSON).
With all other data types, it disables the DataMapper's infinite loop detection in case of a
missing Goto step. It is meant to be used in situations that would otherwise require a
dummy Goto step.
l Collection (only with For Each):
l For XML: the XPath that specifies the level and (optionally) elements to select on
that level. For an overview of XPath functions, see Mozilla: XPath Functions.
To select elements you can either use static values, e.g. ./user
[@lastname="Smith"] or JavaScript statements, for example: =./user
[@lastname="{automation.jobInfo.JobInfo1}"].
In order to use JavaScript: Note that since the XPath is a string, the return value of
the JavaScript statement will be interpreted as a string.
l For JSON: the JsonPath that specifies the level and (optionally) elements to select
on that level. For an overview of the JsonPath syntax, see https://github.com/json-
path/jsonpath.
It is not possible to use Javascript in the JsonPath.
Page 362