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

Notifications

Announcements

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard