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 :
Power Automate - Building Flows
Unanswered

Append simple arrays together while still keeping them as separate arrays

(0) ShareShare
ReportReport
Posted on by 2
How do I append a list of simple arrays together while still keeping them as separate arrays within a larger structure?
 
I need to compose a body of arrays in this format:
[
[
a1,
a2,
a3,
a4,...
],
[
b1,
b2,
b3,
b4,...
]
]
 
Each array is being generated within a for_each loop, so I wanted to use append to array variable, but I am getting the following error:
 
 
 
I have the same question (0)
  • eliotcole Profile Picture
    4,280 Moderator on at
    Append simple arrays together while still keeping them as separate arrays
    Hi, @HI-18092034-0, could you please try the below, instead?
    1. Do NOT Concur - Change the 'For each' loop to run with no concurrency:
      1. Go to the settings and ensure that concurrency is on
      2. Set it to: 1
    2. Set Not Append - Inside your for each loop, perform the following actions:
      1. Data Prep - Before your current 'Append to array variable' add an action called 'DataPrepCNST' or something ... (use Compose or Parse JSON - I prefer the latter with '{}' in the schema) and inside that simple place an expression that consists of a single union() function. The two parts of the union() will be below ... if you need to union more, just layer them up:
        1. Each of the arrays you've made
        2. The current value of whatever your array variable is called
      2. Delete Append Action - 😲 ... yep ... remove it
      3. Set Variable - Now place a 'Set variable' action in place of it and ensure that it uses the value from your Data Prep action above!
    If you're worried about any of this, save a copy of your flow before trying it.
    Don't copy my example crap verbatim, either, matey ... make things your own. :-)
    Also ... try a few variations on the above ... you might find a better way! :-)
     
    ---
    I have a more complex response to this, but ... I don't think it is worth going through.
    ---
    Also ... if you would like more help, then, could you please edit your original question by pasting an image so that it is visible on our screens without having to download it of the actions which create the for each loop?
     
    It might aide us in understanding more what is happening, here.
  • HI-18092034-0 Profile Picture
    2 on at
    Append simple arrays together while still keeping them as separate arrays
    @Chriddle The problem is that each simple array is being generated within a for_each loop:
     
    I am not able to simply place the output within a compose that is outside of the loop. Any suggestions?
  • Chriddle Profile Picture
    8,112 Super User 2025 Season 2 on at
    Append simple arrays together while still keeping them as separate arrays
    Simply place the array in a Compose within the loop and call that Compose after the loop.
    This will return an array of all Compose values ​​during the loop.
     
     
    Compose 4:
    outputs('Compose_3')
     
    Output
     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

MS.Ragavendar – Community Spotlight

We are honored to recognize Ragavendar Swaminatha Subramanian as our September…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 797 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 483 Moderator

#3
Power Apps 1919 Profile Picture

Power Apps 1919 339

Last 30 days Overall leaderboard