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 / Error appending items ...
Power Automate
Answered

Error appending items from JSON to Array using Apply to Each loop

(0) ShareShare
ReportReport
Posted on by 62
Hello! I'm currently passing a JSON of values from a powerapps app to Power Automate and am trying to append each value to an array variable. In order to do this, I am using an apply to each loop over each Value in my json, which auto generates an external loop. My flow looks like this:
 
 
I feel as though this should work, however I am running into this error:
 
The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@items('Apply_to_each_2')['Value']' is of type 'Integer'. The result must be a valid array.
 
To be honest, I'm really not sure how to parse this, as I don't need the "output" of the loop. I just need the append to array function. Anyone able to help?
Categories:
I have the same question (0)
  • Verified answer
    Kalathiya Profile Picture
    2,139 Super User 2026 Season 1 on at
    Hello @AB-03121629-0
     

    You do not need the inner Apply to each at all. So

    Remove both apply to each. 
    Readd the append to array variable and Select the value
    Because your JSON is already an Array of Objects
     
     
     
    ---------------------------------------------------------------------------------
     
    📩 Need more help? Mention @Kalathiya anytime!
    ✔️ Don’t forget to Accept as Solution if this guidance worked for you.
    💛 Your Like motivates me to keep helping!
  • Chriddle Profile Picture
    8,686 Super User 2026 Season 1 on at
    If it's just about creating a variable from the JSON, just initialize the variable with this data.

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 784

#2
Valantis Profile Picture

Valantis 581

#3
Haque Profile Picture

Haque 545

Last 30 days Overall leaderboard