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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Access multiple arrays...
Power Automate
Unanswered

Access multiple arrays from Apply to Each

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I am new to Power Automate so please bear with me, I would really appreciate any help I can get here.

 

I have two arrays (IdArray, CompanyId) and I am trying to take the data from each array and create new items on a SharePoint list. I can only access one of the arrays from inside the Apply to Each. How can I access the CompanyId array and apply it when creating the items?

 

IdArray = XML ID

CompanyId = Title

 

example_2.PNG

 

You can only reference one output and the output from the second array comes through as the array itself if not set as the output from previous steps.

Categories:
I have the same question (0)
  • alrezac Profile Picture
    Microsoft Employee on at

    Hi,

     

    You should be able to nest apply to each in the way that I did in my picture below; Take a look and try that out.

     

    Untitled.png

     

    Regards,

     

    Alex

     

    -------

     

    Community Support Team _ Alex Rezac
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thank you for your reply @alrez 

     

    When testing nesting multiple 'Apply to Each', I do gain access to each array in the parent 'apply to each'. However, when I run this flow, I now get 3 sets of each company with each ID. I'm looking to get each company with their respective ID.

     

    nesting_ate.PNG

     

    nesting_ate_results.PNG

     

    Maybe this needs to be created off an ID and then update each item based off that ID with additional 'apply to each' functions?

  • alrezac Profile Picture
    Microsoft Employee on at

    Hi,

     

    Can you try writing this to variables instead of using composes. Initialize the variables at the top level at the beginning of the flow and set the variable every time it changes. Then you can call the variable within the nested flows. Using current item will only return the value the flow thinks it needs for that level.

     

    Regards,

     

    Alex

     

    -------

     

    Community Support Team _ Alex Rezac
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hello @alrez,

    Thank you for your reply.

     

    I have changed the flow to use variables instead of compose. I still need to use compose when using xPath on the XML to get the elements. My first for each function assigns the values to the index as well as uses the append to remove the xml tags. I then have set the variable, where I initially would compose. I am not able to select those variables from within the dynamic content menu inside of the Create Item within the final Apply To Each. Please see the image below:

     

    example_3.PNG

     

    Do I need to reset the variable somewhere in here?

     

    Thank you for your help!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 103 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 87

#3
trice602 Profile Picture

trice602 63 Super User 2026 Season 1

Last 30 days Overall leaderboard