web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : 2c5fzYYpkI8lq2xGjhvusb
Power Automate - Building Flows
Unanswered

Referencing outputs from Loop-A to Loop-B?

Like (0) ShareShare
ReportReport
Posted on 8 Jul 2019 21:07:47 by 8

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.

  • si2019 Profile Picture
    8 on 09 Jul 2019 at 14:39:14
    Re: Referencing outputs from Loop-A to Loop-B?

    @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.

    FlowTest.jpg

  • Pstork1 Profile Picture
    67,176 Most Valuable Professional on 09 Jul 2019 at 14:18:13
    Re: Referencing outputs from Loop-A to Loop-B?

    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.

  • si2019 Profile Picture
    8 on 09 Jul 2019 at 13:28:09
    Re: Referencing outputs from Loop-A to 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.

  • si2019 Profile Picture
    8 on 09 Jul 2019 at 13:24:34
    Re: Referencing outputs from Loop-A to Loop-B?

    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.

  • v-bacao-msft Profile Picture
    on 09 Jul 2019 at 04:12:35
    Re: Referencing outputs from Loop-A to Loop-B?

    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,

  • Pstork1 Profile Picture
    67,176 Most Valuable Professional on 08 Jul 2019 at 21:17:11
    Re: Referencing outputs from Loop-A to Loop-B?

    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 2

Loading complete