Hi,
How do I pass value generated from an "Apply to each" loop and to refer it in another loop, or just to use outside of the loop?
Thank you.
@Pstork1, Append to Array Variable inside Loop A did not give me the Dynamic content to select its output.
Below is the Flow I'm trying to do. Basically, a Flow to automatically add/remove mebers from a Teams based on a CSV file from OneDrive.
Thanks again for your advises.
The loop doesn't automatically create an Array variable. But if you initialize an Array variable before entering the loop then there is an action where you can append to array variable inside the body of Loop A. That will produce the array you need for Loop B.
@v-bacao-msft, what expression do I use to referencing a loop value as an Array variable from outside of it?
Thank you.
Thanks for your fast response, sir.
I tried nesting loop but it required output from Loop A as an Array variable in order for Loop B to process. How do I do that?
* I'm a newbie explorering my first MS Flow.
Thanks, again.
Hi @si2019 ,
You could provide more details of your needs.
Basically we could reference the specified value through variables and Dynamic content that can be used in nested loops.
Or you could use expression to reference a specified value based on a specific property.
We need more details about specific need to provide more detailed instructions.
Best Regards,
If its a value generated during each loop then there is no easy way to do it. If its something like a total or an aggregation of the content in the loop then you can save that in a Variable to use in another loop. If you need the output of a single loop then you should embed Loop B inside Loop A. The current value of Loop A will be available in Loop B.
Michael E. Gernaey
497
Super User 2025 Season 2
David_MA
436
Super User 2025 Season 2
Riyaz_riz11
244
Super User 2025 Season 2