bmel:forRange¶
Category: Logic & Control Flow · Returns: bmel:array
bmel:forRange(from: bmel:integer, to: bmel:integer, body: bmel:expression)
Description¶
Iterates from from to to (both inclusive, step +1) and evaluates body at each step, collecting results into an array. Within body, the current loop index is accessible as bmel:i. Returns an empty array when from > to.
Arguments¶
| Parameter | Type | Required | Description |
|---|---|---|---|
from | bmel:integer | Start index (inclusive). | |
to | bmel:integer | End index (inclusive). | |
body | bmel:expression | Expression evaluated at each iteration step. The current index is accessible as bmel:i. |
Example¶
bmel:forRange(1, bmel:count({order:Response Payload}.$.items), bmel:i)