Skip to content

Commit be4e589

Browse files
authored
Merge pull request #112250 from ecfan/patch-8
Fix iterationIndexes example
2 parents 4ea19c6 + d3577c2 commit be4e589

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

articles/logic-apps/workflow-definition-language-functions-reference.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2499,8 +2499,7 @@ items('myForEachLoopName')
24992499

25002500
### iterationIndexes
25012501

2502-
Return the index value for the current iteration inside an Until loop.
2503-
You can use this function inside nested Until loops.
2502+
Return the index value for the current iteration inside an Until loop. You can use this function inside nested Until loops.
25042503

25052504
```
25062505
iterationIndexes('<loopName>')
@@ -2518,17 +2517,11 @@ iterationIndexes('<loopName>')
25182517

25192518
*Example*
25202519

2521-
This example creates a counter variable and increments that
2522-
variable by one during each iteration in an Until loop until
2523-
the counter value reaches five. The example also creates a
2524-
variable that tracks the current index for each iteration.
2525-
In the Until loop, during each iteration, the example increments
2526-
the counter and then assigns the counter value to the current
2527-
index value and then increments the counter. At any time,
2528-
you can determine the current iteration number by
2529-
retrieving the current index value.
2520+
This example creates a counter variable and increments that variable by one during each iteration in an Until loop until the counter value reaches five. The example also creates a variable that tracks the current index for each iteration. In the Until loop, during each iteration, the example increments the counter and then assigns the counter value to the current index value and then increments the counter. While in the loop, this example references the current iteration index by using the `iterationIndexes` function:
25302521

2531-
```
2522+
`iterationIndexes('Until_Max_Increment')`
2523+
2524+
```json
25322525
{
25332526
"actions": {
25342527
"Create_counter_variable": {
@@ -2559,7 +2552,7 @@ retrieving the current index value.
25592552
"Create_counter_variable": [ "Succeeded" ]
25602553
}
25612554
},
2562-
"Until": {
2555+
"Until_Max_Increment": {
25632556
"type": "Until",
25642557
"actions": {
25652558
"Assign_current_index_to_counter": {
@@ -2572,6 +2565,15 @@ retrieving the current index value.
25722565
"Increment_variable": [ "Succeeded" ]
25732566
}
25742567
},
2568+
"Compose": {
2569+
"inputs": "'Current index: ' @{iterationIndexes('Until_Max_Increment')}",
2570+
"runAfter": {
2571+
"Assign_current_index_to_counter": [
2572+
"Succeeded"
2573+
]
2574+
},
2575+
"type": "Compose"
2576+
},
25752577
"Increment_variable": {
25762578
"type": "IncrementVariable",
25772579
"inputs": {

0 commit comments

Comments
 (0)