From wiki.ginstr.com
Jump to: navigation, search
m (fixed typos)
m (added numberOfRepeats)
Line 75: Line 75:
 
:<code>[gn:act_getRow]|[@variable/employee_allowedDivisions,@variable/divisionIndex;;@variable/currentDivisionText]</code> - action<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>
 +
 +
===Repeat the execution of commands a set number of times===
 +
 +
:;<code>[gn:act_forEach]|[@variable/numberOfRepeats]</code>
 +
 +
:{| class="wikitable sortable" style="font-size: 85%; text-align: left;"
 +
|-
 +
! scope="col" | Parameter
 +
! scope="col" | Description
 +
|-
 +
| <code>numberOfRepeats</code>
 +
| defines manually the number of times to repeat the execution of commands, instead of by row count
 +
Can be
 +
* hardcoded - integer value, i.e. <code>3</code>
 +
|}
 
<hr>
 
<hr>

Revision as of 15:21, 29 May 2018

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
Controlling action
gn:act_break is used to stop gn:act_forEach action execution

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]]

Repeat the execution of commands a set number of times

[gn:act_forEach]|[@variable/numberOfRepeats]
Parameter Description
numberOfRepeats defines manually the number of times to repeat the execution of commands, instead of by row count

Can be

  • hardcoded - integer value, i.e. 3