Files
doc-exports/docs/dataartsstudio/umn/dataartsstudio_01_0534.html
chenxiaoxiong c3942cbc2c DataArts UMN 20241028 version
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: chenxiaoxiong <chenxiaoxiong@huawei.com>
Co-committed-by: chenxiaoxiong <chenxiaoxiong@huawei.com>
2025-07-09 13:09:06 +00:00

63 lines
6.6 KiB
HTML

<a name="dataartsstudio_01_0534"></a><a name="dataartsstudio_01_0534"></a>
<h1 class="topictitle1">Loop Embedded Objects</h1>
<div id="body8662426"><p id="dataartsstudio_01_0534__en-us_topic_0226521571_p6373151120335">You can use Loop embedded objects to obtain data from the For Each node.</p>
<div class="section" id="dataartsstudio_01_0534__en-us_topic_0226521571_section18267348332"><h4 class="sectiontitle">Property</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dataartsstudio_01_0534__en-us_topic_0226521571_table874717402336" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Property description</caption><thead align="left"><tr id="dataartsstudio_01_0534__en-us_topic_0226521571_row167470408331"><th align="left" class="cellrowborder" valign="top" width="16.50834916508349%" id="mcps1.3.2.2.2.5.1.1"><p id="dataartsstudio_01_0534__en-us_topic_0226521571_p1774714014337">Property</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="11.768823117688232%" id="mcps1.3.2.2.2.5.1.2"><p id="dataartsstudio_01_0534__en-us_topic_0226521571_p1427019552810">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="34.546545345465454%" id="mcps1.3.2.2.2.5.1.3"><p id="dataartsstudio_01_0534__en-us_topic_0226521571_p177471640193311">Description</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="37.176282371762824%" id="mcps1.3.2.2.2.5.1.4"><p id="dataartsstudio_01_0534__p1269919517218">Example</p>
</th>
</tr>
</thead>
<tbody><tr id="dataartsstudio_01_0534__en-us_topic_0226521571_row1747740123312"><td class="cellrowborder" valign="top" width="16.50834916508349%" headers="mcps1.3.2.2.2.5.1.1 "><p id="dataartsstudio_01_0534__en-us_topic_0226521571_p14227161014914">dataArray</p>
</td>
<td class="cellrowborder" valign="top" width="11.768823117688232%" headers="mcps1.3.2.2.2.5.1.2 "><p id="dataartsstudio_01_0534__en-us_topic_0226521571_p5270165520819">String</p>
</td>
<td class="cellrowborder" valign="top" width="34.546545345465454%" headers="mcps1.3.2.2.2.5.1.3 "><p id="dataartsstudio_01_0534__p95583381321"><strong id="dataartsstudio_01_0534__b96391027193911">Loop.dataArray</strong> indicates the two-dimensional array defined in the dataset of the For Each node.</p>
<p id="dataartsstudio_01_0534__p16628131531416">Generally, the format is <strong id="dataartsstudio_01_0534__b1565019613365">#{Loop.dataArray[0][0]}</strong> or <strong id="dataartsstudio_01_0534__b8688181015368">#{Loop.dataArray[0][1]}</strong>. <strong id="dataartsstudio_01_0534__b1952351617365">[0][0]</strong> indicates the first value in the first row of the array, and <strong id="dataartsstudio_01_0534__b480911295365">[0][1]</strong> indicates the second value in the first row, and so on.</p>
</td>
<td class="cellrowborder" valign="top" width="37.176282371762824%" headers="mcps1.3.2.2.2.5.1.4 "><p id="dataartsstudio_01_0534__p137266614213">The value of <strong id="dataartsstudio_01_0534__b5476113714376">Subjob Parameter</strong> for the For Each node indicates that the first value in the second row of the two-dimensional array in the dataset is always used in the For Each loop.</p>
<p id="dataartsstudio_01_0534__p15666215121118">#{Loop.dataArray[1][0]}</p>
</td>
</tr>
<tr id="dataartsstudio_01_0534__en-us_topic_0226521571_row3747154018335"><td class="cellrowborder" valign="top" width="16.50834916508349%" headers="mcps1.3.2.2.2.5.1.1 "><p id="dataartsstudio_01_0534__en-us_topic_0226521571_p722615101794">current</p>
</td>
<td class="cellrowborder" valign="top" width="11.768823117688232%" headers="mcps1.3.2.2.2.5.1.2 "><p id="dataartsstudio_01_0534__en-us_topic_0226521571_p1827116553813">String</p>
</td>
<td class="cellrowborder" valign="top" width="34.546545345465454%" headers="mcps1.3.2.2.2.5.1.3 "><p id="dataartsstudio_01_0534__p1461001614314">For Each nodes process data in a dataset by row. <strong id="dataartsstudio_01_0534__b14108183511394">Loop.current</strong> indicates a row of a two-dimensional array defined in the dataset of the For Each node. This row is a one-dimensional array.</p>
<p id="dataartsstudio_01_0534__p398702716156">Generally, the format is similar to <strong id="dataartsstudio_01_0534__b1256618126414">#{Loop.current[0]}</strong>, <strong id="dataartsstudio_01_0534__b963232064110">#{Loop.current[1]}</strong>, or others. <strong id="dataartsstudio_01_0534__b953123810416">[0]</strong> indicates the first value in the current row, <strong id="dataartsstudio_01_0534__b1695914614414">[1]</strong> indicates the second value in the current row, and so on.</p>
</td>
<td class="cellrowborder" valign="top" width="37.176282371762824%" headers="mcps1.3.2.2.2.5.1.4 "><p id="dataartsstudio_01_0534__p1368430191110">The value of <strong id="dataartsstudio_01_0534__b38633123428">Subjob Parameter</strong> for the For Each node indicates that the second value in the traversed row of the two-dimensional array in the dataset is always used in the loop traversal of the For Each node.</p>
<p id="dataartsstudio_01_0534__p18686304118">#{Loop.current[1]}</p>
</td>
</tr>
<tr id="dataartsstudio_01_0534__en-us_topic_0226521571_row197471240123319"><td class="cellrowborder" valign="top" width="16.50834916508349%" headers="mcps1.3.2.2.2.5.1.1 "><p id="dataartsstudio_01_0534__en-us_topic_0226521571_p7191210195">offset</p>
</td>
<td class="cellrowborder" valign="top" width="11.768823117688232%" headers="mcps1.3.2.2.2.5.1.2 "><p id="dataartsstudio_01_0534__en-us_topic_0226521571_p92711554820">Int</p>
</td>
<td class="cellrowborder" valign="top" width="34.546545345465454%" headers="mcps1.3.2.2.2.5.1.3 "><p id="dataartsstudio_01_0534__en-us_topic_0226521571_p7883167101113">Current offset of the For Each node, starting from 0.</p>
<p id="dataartsstudio_01_0534__en-us_topic_0226521571_p362114125910">Loop.dataArray[Loop.offset] = Loop.current.</p>
</td>
<td class="cellrowborder" valign="top" width="37.176282371762824%" headers="mcps1.3.2.2.2.5.1.4 "><p id="dataartsstudio_01_0534__p5726136192113">Obtain the current offset of the For Each loop, that is, the number of traversals, starting from 0.</p>
<p id="dataartsstudio_01_0534__p137261469214">#{Loop.offset}</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="dataartsstudio_01_0534__section1336518910618"><h4 class="sectiontitle">Example</h4><p id="dataartsstudio_01_0534__en-us_topic_0132846500_p1726613116446">To obtain the second value of a row that is being processed, use the following EL expression:</p>
</div>
<pre class="screen" id="dataartsstudio_01_0534__screen1436516918618">#{Loop.current[1]}</pre>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dataartsstudio_01_0493.html">EL Expression Reference</a></div>
</div>
</div>