In my head it would be dependent on the loop and not the fields.
i would think it would do loop 1 and within that loop A and B. then loop 2, and loop A and B. so the final result is 1A, 1B, 2A, 2B
Your conceptual intuition is a reasonable assumption based upon programming experience, but unfortunately not how nested loops actually work in the system.
The problem is with the field mappings within this action:
Assigning an action to a loop does not confer any scope. All that happens is that the Loop examines the output of the referenced action to determine how many iterations to perform, by finding the output field with the largest array of values.
So the nested loop works in the same way. It looks at the mapped action above it to determine how many iterations to perform based on its output fields’ largest array.
The problem is with the inner action’s mapped fields. You are probably expecting mappings back to actions to somehow be scoped to the outer loop. That isn’t what happens. The inner loop controls the array index when fetching mapped array field values. So based on the largest array size from action #10.L.1, the system then examines the mapped fields within action #10.L.2.L.1 and sequentially maps array data based on the index counter of the inner loop iteration. It is not using the index of the outer loop when determining field mappings to actions scoped outside the outer loop.
So the approach is to fetch the needed fields within the outer loop and before the nested loop (e.g. maybe use Transform Text replace text actions that replace nothing…just as a way of grabbing the mapped array field values and emitting them). That gives you scope to array data you expect the outer loop to have. Then the inner loop’s action refers to those Transform Text output values. You would keep its mapping to data from #10.L.1 b/c that is the action’s output being looped upon.
Hope this makes sense. Let me know if you need further help with it.