From wiki.ginstr.com
Jump to: navigation, search
(Repeat the execution of commands based on list source with defined column name)
m (formatting)
Line 10: Line 10:
 
===Repeat the execution of commands based on list source===
 
===Repeat the execution of commands based on list source===
  
;<code>[gn:act_forEach]|[source;ACTIONS]</code>
+
:;<code>[gn:act_forEach]|[source;ACTIONS]</code>
  
{| class="wikitable sortable" style="font-size: 85%; text-align: left;"
+
:{| class="wikitable sortable" style="font-size: 85%; text-align: left;"
 
|-
 
|-
 
! scope="col" | Parameter
 
! scope="col" | Parameter
 
! scope="col" | Description
 
! scope="col" | Description
 
|-
 
|-
| [[source]]
+
| <code>[[source]]</code>
 
| [[source]] from where the while action is using value as expression parameter
 
| [[source]] from where the while action is using value as expression parameter
 
* Valid [[source|sources]]:
 
* Valid [[source|sources]]:
** [[Datatypes#rows|rows]]
+
** <code>[[Datatypes#rows|rows]]</code>
** [[Datatypes#rowsColumn|rowsColumn]]
+
** <code>[[Datatypes#rowsColumn|rowsColumn]]</code>
** [[Datatypes#pictures|pictures]]
+
** <code>[[Datatypes#pictures|pictures]]</code>
** [[Datatypes#email|email]]
+
** <code>[[Datatypes#email|email]]</code>
 
|-
 
|-
| [[Action_Library|ACTIONS]]
+
| <code>[[Action_Library|ACTIONS]]</code>
 
| list of actions which will be executed continuously until all rows are iterated
 
| list of actions which will be executed continuously until all rows are iterated
 
|-
 
|-
Line 31: Line 31:
  
 
====Example====
 
====Example====
<code>variable/listId</code> - list used for iteration<br>
+
:<code>variable/listId</code> - list used for iteration<br>
<code>variable/listId(rowColumnName1)</code> - retrieving value from rowColumnName1 column of iterated row<br><br>
+
:<code>variable/listId(rowColumnName1)</code> - retrieving value from <code>rowColumnName1</code> column of iterated row<br>
<code>[gn:act_forEach]|[variable/listId;[gn:act_rawWriteValues]|[tableId;column1,column2;variable/listId(rowColumnName1),+id/listRow]]
+
:; ⤷ <code>[gn:act_forEach]|[variable/listId;[gn:act_rawWriteValues]|[tableId;column1,column2;variable/listId(rowColumnName1), +id/listRow]]</code>
</code>
+
 
 
<hr>
 
<hr>
  
 
===Repeat the execution of commands based on list source with defined column name===
 
===Repeat the execution of commands based on list source with defined column name===
  
;<code>[gn:act_forEach]|[source,column;ACTIONS]</code>
+
:;<code>[gn:act_forEach]|[source,column;ACTIONS]</code>
  
{| class="wikitable sortable" style="font-size: 85%; text-align: left;"
+
:{| class="wikitable sortable" style="font-size: 85%; text-align: left;"
 
|-
 
|-
 
! scope="col" | Parameter
 
! scope="col" | Parameter
 
! scope="col" | Description
 
! scope="col" | Description
 
|-
 
|-
| [[source]]
+
| <code>[[source]]</code>
 
| [[source]] from where the while action is using value as expression parameter
 
| [[source]] from where the while action is using value as expression parameter
 
* Valid [[source|sources]]:
 
* Valid [[source|sources]]:
** [[Datatypes#rows|rows]]
+
** <code>[[Datatypes#rows|rows]]</code>
** [[Datatypes#rowsColumn|rowsColumn]]
+
** <code>[[Datatypes#rowsColumn|rowsColumn]]</code>
 
|-
 
|-
| [[configuration.xml#Column|column]]
+
| <code>[[configuration.xml#Column|column]]</code>
| [[configuration.xml#Column|column]] name which will be internaly added as parameter to [[source]] reference names in actions which will be executed in forEach action.
+
| [[configuration.xml#Column|column]] name which will be internally added as parameter to [[source]] reference names in actions which will be executed in for each action.
 
:e.g.
 
:e.g.
:<code>[gn:act_getRow]|[@variable/employee_allowedDivisions,@variable/divisionIndex;;@variable/currentDivisionText]</code>
+
:<code>[gn:act_getRow]|[@variable/employee_allowedDivisions, @variable/divisionIndex;;@variable/currentDivisionText]</code>
 
:to
 
:to
:<code>[gn:act_getRow]|[@variable/employee_allowedDivisions(divisionName),@variable/divisionIndex;;@variable/currentDivisionText]</code>
+
:<code>[gn:act_getRow]|[@variable/employee_allowedDivisions(divisionName), @variable/divisionIndex;;@variable/currentDivisionText]</code>
  
 
* Valid [[source|sources]]:
 
* Valid [[source|sources]]:
 
** hardcoded
 
** hardcoded
 
|-
 
|-
| [[Action_Library|ACTIONS]]
+
| <code>[[Action_Library|ACTIONS]]</code>
 
| list of actions which will be executed continuously until all rows are iterated
 
| list of actions which will be executed continuously until all rows are iterated
 
|-
 
|-
Line 68: Line 68:
  
 
====Example====
 
====Example====
<code>@variable/employee_allowedDivisions</code> - list used for iteration<br>
+
:<code>@variable/employee_allowedDivisions</code> - list used for iteration<br>
<code>divisionName</code> - column name<br>
+
:<code>divisionName</code> - column name<br>
<code>[gn:act_getRow]|[@variable/employee_allowedDivisions,@variable/divisionIndex;;@variable/currentDivisionText]</code> - action<br><br>
+
:<code>[gn:act_getRow]|[@variable/employee_allowedDivisions,@variable/divisionIndex;;@variable/currentDivisionText]</code> - action<br>
<code>[gn:act_forEach]|[@variable/employee_allowedDivisions,divisionName;[gn:act_getRow]|[@variable/employee_allowedDivisions,@variable/divisionIndex;;@variable/currentDivisionText]]</code>
+
:; ⤷ <code>[gn:act_forEach]|[@variable/employee_allowedDivisions, divisionName;[gn:act_getRow]|[@variable/employee_allowedDivisions, @variable/divisionIndex;;@variable/currentDivisionText]]</code>
 
<hr>
 
<hr>

Revision as of 19:33, 12 July 2017

gn:act_forEach

Description
Used exclusively with Variables of rows, rowsColumn, pictures, email datatypes, to repeat the execution of commands, for each element in the list parameter
Action returns
void

Action signatures

Repeat the execution of commands based on list source

[gn:act_forEach]|[source;ACTIONS]
Parameter Description
source source from where the while action is using value as expression parameter
ACTIONS list of actions which will be executed continuously until all rows are iterated

Example

variable/listId - list used for iteration
variable/listId(rowColumnName1) - retrieving value from rowColumnName1 column of iterated row
[gn:act_forEach]|[variable/listId;[gn:act_rawWriteValues]|[tableId;column1,column2;variable/listId(rowColumnName1), +id/listRow]]

Repeat the execution of commands based on list source with defined column name

[gn:act_forEach]|[source,column;ACTIONS]
Parameter Description
source source from where the while action is using value as expression parameter
column column name which will be internally added as parameter to source reference names in actions which will be executed in for each action.
e.g.
[gn:act_getRow]|[@variable/employee_allowedDivisions, @variable/divisionIndex;;@variable/currentDivisionText]
to
[gn:act_getRow]|[@variable/employee_allowedDivisions(divisionName), @variable/divisionIndex;;@variable/currentDivisionText]
ACTIONS list of actions which will be executed continuously until all rows are iterated

Example

@variable/employee_allowedDivisions - list used for iteration
divisionName - column name
[gn:act_getRow]|[@variable/employee_allowedDivisions,@variable/divisionIndex;;@variable/currentDivisionText] - action
[gn:act_forEach]|[@variable/employee_allowedDivisions, divisionName;[gn:act_getRow]|[@variable/employee_allowedDivisions, @variable/divisionIndex;;@variable/currentDivisionText]]