cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
si2019
Level: Powered On

Referencing outputs from Loop-A to Loop-B?

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.

6 REPLIES 6
Super User
Super User

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.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Community Support Team
Community Support Team

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,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
si2019
Level: Powered On

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.

si2019
Level: Powered On

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.

Super User
Super User

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.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
si2019
Level: Powered On

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

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 534 members 5,306 guests
Please welcome our newest community members: