Configure the script to process and sequentially output values from the array using blocks Expression, Condition and Information.
This example uses an array created in a block An expression containing the following values:
$array = [1, 2, 3, 4, 5]
Set the cycle limit:
1.1. Go to the Settings block.
1.2. Set the maximum number of cycles — 99 .
Initialize the variables. To do this, add a block The expression with this code:
$arr = [1, 2, 3, 4, 5]
$count = $arr.count()
$counter = 0
Add the following block Expression for iterating over array elements:
$data = $arr.get($counter)
$output = str.join([$output, $data, "\n"], "")
$counter = $counter + 1
Set up the condition:
4.1. Create a block Condition:
Add the Information block to output the variable {output}, which contains the final result.
The result should be: