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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to select the outp...
Power Automate
Answered

How to select the output of a previous steps

(0) ShareShare
ReportReport
Posted on by 79

Hi all,

 

I am stuck trying to select the output from the previous step. My goal is to get the output from "Apply to each" to use it in a new "Apply to each 2". How can achieve this, please? maybe I need variables? if yes, not sure how to implement it.

 

H_Insights_1-1647807289584.png

 

Your help is highly appreciated.

 

Categories:
I have the same question (2)
  • Verified answer
    Pstork1 Profile Picture
    68,707 Most Valuable Professional on at

    There normally is no Output of an apply to each action.  However, if you want an array of items created by one apply to each that you can use in a new apply to each you can add a Compose as you do in the screenshot above.  Then the following code will retrieve an array of all the items added to the Compose statement inside the first loop after you exit the loop.

    outputs('ComposeActionName')
  • H_Insights Profile Picture
    79 on at

    Hi @Pstork1 

     

    Thanks for looking into my question. 

     

    I have tried adding the expression as below:

    outputs('Compose')

     

    H_Insights_1-1647808996036.png

     

    But still, I can't see the array of items when I try to do any more actions?

     

    H_Insights_0-1647808854774.png

     

  • Pstork1 Profile Picture
    68,707 Most Valuable Professional on at

    What does the compose look like inside the first loop?  if its just a value then you won't see a choice in the dynamic content other than current item because its not a name value pair.  I could give you a better answer if I had an idea what you are trying to accomplish.

  • H_Insights Profile Picture
    79 on at

    In summary, my flow goal is to:

     

    1- When a condition is met, create an SP list;

    2- Then prompt the user to add comments via MS Teams;

    3- Once a comment is made, the flow will update the SP column.

     

    My original flow gets triggered manually from power bi, but the issue is that the flow creates a single row of data on the SP list until the first user responds to the MS team's message. That’s why I am breaking the process into:

     

    a) Apply to Each: to create the SP list when the condition is met (not to wait for the user's input).

    b) Apply to Each 2: Send MS teams messages and get the user's comments to update the SP.

     

    So, 'Compose' contains the SP links to items, so the flow can update it later when I have the user's input.

     

    Proposed:                                                                                    Original:

    H_Insights_1-1647815544076.pngH_Insights_4-1647816001277.png

     

                                 

    Thanks again for your time.

     

     

  • Pstork1 Profile Picture
    68,707 Most Valuable Professional on at

    If the Compose in the first loop is the link to item, then the array you'll get is a simple array of links when you use outputs('Compose') after the first loop exits.  So in the second loop the Current Item dynamic content will contain each link. Since the compose didn't create a record, just a value it will be a simple array rather than an array of objects.  That's why there is no dynamic content in the second loop other than current item.

  • Riyaz_riz11 Profile Picture
    3,860 Super User 2025 Season 2 on at

    Hi @H_Insights ,

    You can try output('compose') here you will get compose result.

    Next action if you are passing inside apply to each you can try this it will work for you.

    you can pass expression eg:---

    items('Apply_to_each')['Emp Code'])
    Here Emp_Code is a value you can mention your source name, or identity .
    It will work as expected.
     

    Regards

    Ahammad Riyaz

    --------------------------------------------------------------------------------
    If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

  • H_Insights Profile Picture
    79 on at

    Thanks all for your input.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard