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 / Combine 'apply to each...
Power Automate
Answered

Combine 'apply to each' output array of records into a single array

(1) ShareShare
ReportReport
Posted on by 876 Super User 2026 Season 1
Hello!
 
The apply to each in my flow produces the following results if the item in the apply to each meets certain data processing criteria.
Below are two samples. The first array has two records the second result has one record. Both valid.
I want to append each of the results to a single array.
 
All of my solution tries have failed. Arrays are nested not a single array of records. I'm also getting nulls if the iteration in the loop does not produce results which is valid. The last attempt is pictured below.
 
Any suggestions to combine the 'apply to each' output array of records into a single array?
 
TIA!
 
First sample:
 
[
    {
        "ShopperID": "8123456ff",
        "ItemNumber": "773409",
        "ItemDescription": "Korean BBQ Beef",
        "IsAlcohol": "false",
        "AuditTimeStamp": "2025-08-01T17:07:28.189Z",
        "BatchID": "688d2c111124d34914233333",
        "StoreNumber": "156",
        "RetailPrice": "17.990000000000000000",
        "ScannedQuantity": "1",
        "VoidedQuantity": "0",
        "Type": "Normal",
        "CategoryNotFoundinOrderedItems": "Marinated Meats"
    },
    {
        "ShopperID": "8123456ff",
        "ItemNumber": "43531",
        "ItemDescription": "Org Mayo",
        "IsAlcohol": "false",
        "AuditTimeStamp": "2025-07-28T18:12:10.336Z",
        "BatchID": "6887f59b8cb6773788622222",
        "StoreNumber": "156",
        "RetailPrice": "5.990000000000000000",
        "ScannedQuantity": "1",
        "VoidedQuantity": "0",
        "Type": "Normal",
        "CategoryNotFoundinOrderedItems": "MAYO & VISCOUS DRESSING"
    }
]
 
Second sample:
 
[
    {
        "ShopperID": "tp123es2z",
        "ItemNumber": "276604",
        "ItemDescription": "Hd Mango Sorbet",
        "IsAlcohol": "false",
        "AuditTimeStamp": "2025-07-31T19:39:22.722Z",
        "BatchID": "688bfd381124d34914111111",
        "StoreNumber": "111",
        "RetailPrice": "5.990000000000000000",
        "ScannedQuantity": "1",
        "VoidedQuantity": "1",
        "Type": "Void",
        "CategoryNotFoundinOrderedItems": "ICE CREAM PINTS"
    }
]
 
I want to combine these into a single array of objects.
 
 
Failed solution try ...
 
 
Categories:
I have the same question (0)
  • Verified answer
    Pstork1 Profile Picture
    69,471 Most Valuable Professional on at
    Create an array variable and append the array produced in the loop to the array variable.  When you finish all the records will be in the array variable.  

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
  • Cgangweg01 Profile Picture
    876 Super User 2026 Season 1 on at
    Thanks @Pstork1,
     
    I don't know what I was thinking. I had that approach earlier but something else needed fixing upstream and I lost track. I think I had the append in the wrong nest originally too.
     

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!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 801

#2
Valantis Profile Picture

Valantis 602

#3
Haque Profile Picture

Haque 581

Last 30 days Overall leaderboard