You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/docs/content/docs/en/blocks/loop.mdx
+42-8Lines changed: 42 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -124,11 +124,44 @@ Choose between four types of loops:
124
124
3. Drag other blocks inside the loop container
125
125
4. Connect the blocks as needed
126
126
127
-
### Accessing Results
127
+
### Referencing Loop Data
128
128
129
-
After a loop completes, you can access aggregated results:
129
+
There's an important distinction between referencing loop data from **inside** vs **outside** the loop:
130
130
131
-
-**`<loop.results>`**: Array of results from all loop iterations
131
+
<Tabsitems={['Inside the Loop', 'Outside the Loop']}>
132
+
<Tab>
133
+
**Inside the loop**, use `<loop.>` references to access the current iteration context:
134
+
135
+
- **`<loop.index>`**: Current iteration number (0-based)
136
+
- **`<loop.currentItem>`**: Current item being processed (forEach only)
137
+
- **`<loop.items>`**: Full collection being iterated (forEach only)
138
+
139
+
```
140
+
// Inside a Function block within the loop
141
+
const idx = <loop.index>; // 0, 1, 2, ...
142
+
const item = <loop.currentItem>; // Current item
143
+
```
144
+
145
+
<Callouttype="info">
146
+
These references are only available for blocks **inside** the loop container. They give you access to the current iteration's context.
147
+
</Callout>
148
+
</Tab>
149
+
<Tab>
150
+
**Outside the loop** (after it completes), reference the loop block by its name to access aggregated results:
151
+
152
+
- **`<LoopBlockName.results>`**: Array of results from all iterations
153
+
154
+
```
155
+
// If your loop block is named "Process Items"
156
+
const allResults = <processitems.results>;
157
+
// Returns: [result1, result2, result3, ...]
158
+
```
159
+
160
+
<Callouttype="info">
161
+
After the loop completes, use the loop's block name (not `loop.`) to access the collected results. The block name is normalized (lowercase, no spaces).
Copy file name to clipboardExpand all lines: apps/docs/content/docs/en/blocks/parallel.mdx
+45-11Lines changed: 45 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -76,11 +76,44 @@ Choose between two types of parallel execution:
76
76
3. Drag a single block inside the parallel container
77
77
4. Connect the block as needed
78
78
79
-
### Accessing Results
79
+
### Referencing Parallel Data
80
80
81
-
After a parallel block completes, you can access aggregated results:
81
+
There's an important distinction between referencing parallel data from **inside** vs **outside** the parallel block:
82
82
83
-
-**`<parallel.results>`**: Array of results from all parallel instances
83
+
<Tabsitems={['Inside the Parallel', 'Outside the Parallel']}>
84
+
<Tab>
85
+
**Inside the parallel**, use `<parallel.>` references to access the current instance context:
86
+
87
+
- **`<parallel.index>`**: Current instance number (0-based)
88
+
- **`<parallel.currentItem>`**: Item for this instance (collection-based only)
89
+
- **`<parallel.items>`**: Full collection being distributed (collection-based only)
90
+
91
+
```
92
+
// Inside a Function block within the parallel
93
+
const idx = <parallel.index>; // 0, 1, 2, ...
94
+
const item = <parallel.currentItem>; // This instance's item
95
+
```
96
+
97
+
<Callouttype="info">
98
+
These references are only available for blocks **inside** the parallel container. They give you access to the current instance's context.
99
+
</Callout>
100
+
</Tab>
101
+
<Tab>
102
+
**Outside the parallel** (after it completes), reference the parallel block by its name to access aggregated results:
103
+
104
+
- **`<ParallelBlockName.results>`**: Array of results from all instances
105
+
106
+
```
107
+
// If your parallel block is named "Process Tasks"
108
+
const allResults = <processtasks.results>;
109
+
// Returns: [result1, result2, result3, ...]
110
+
```
111
+
112
+
<Callouttype="info">
113
+
After the parallel completes, use the parallel's block name (not `parallel.`) to access the collected results. The block name is normalized (lowercase, no spaces).
0 commit comments