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 / Compose in apply to ea...
Power Automate
Unanswered

Compose in apply to each - returns array

(0) ShareShare
ReportReport
Posted on by 31

Can someone please explain me or provide any documentation why "compose" in "apply to each" behave like an array and not just a string? I would expect that "compose" result in this example will return "3" but for some reason returns an array of "[1, 2, 3]".

Why? How from string action can became array?

 

I've seen it in numerous blog posts as a time saver instead of using "append to variable", but never understood why "compose" behave like this.

 

Example:

Input: [1,2,3] Output: [1,2,3]

 

LWus5.jpg

Categories:
I have the same question (0)
  • fchopo Profile Picture
    8,003 Moderator on at

    Hi @Popky 

    I see you're referencing output of "compose 2" outside of the apply to each action, which wouldn't have much sense (compose 3 action). Basically, "compose 3" should be within the apply for each loop.

    "Compose 2" should return each item of the array, and not the full array.

    Hope that helps!

    Ferran

  • Popky Profile Picture
    31 on at

    This post is purely for educational manners, not looking for fix or workaround tbh.

    It does not make much sense I am looking for someone to explain me why its behaving like this with this setup. "Compose 3" here is just for log purpose to display content of "Compose 2" from "apply to each" > [1, 2, 3].

     

  • adedapo Profile Picture
    256 on at

    This is the behaviour of some data operation actions like Compose, Select and Filter.

     

    When accessed outside of a non-nested apply to each, their output becomes an array of the values in the loop. This is the current behaviour but it is not well documented.

     

    This can be useful if you want to replace append to array variable because the loop's concurrent settings can now be set to the maximum thereby improving the flow's performance.

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 March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 873

#2
Valantis Profile Picture

Valantis 820

#3
Haque Profile Picture

Haque 505

Last 30 days Overall leaderboard