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 / Issues using variables...
Power Automate
Answered

Issues using variables when building flows

(0) ShareShare
ReportReport
Posted on by 73

Good morning team, 

 

I am having a problem tying to use variables when building my flow. For some reason it worked on a previous flow build but now its not. For some reason it keeps failing. Here is the error that its throwing:

 

"The execution of template action 'Apply_to_each_2' failed: the result of the evaluation of 'foreach' expression '@items('Apply_to_each')' is of type 'Object'. The result must be a valid array."

 

failure.PNGApply.PNG

Categories:
  • VictorIvanidze Profile Picture
    13,083 on at

    Before "Apply to each 2" create a Compose action and place there

     

    item()

     

    Show the result.

  • v-dezhili-msft Profile Picture
    Microsoft Employee on at

    Hi @Jcourtney1485 ,

     

    I guess you directly select the members Email option directly from the dynamic content, and then flow automatically adds Apply to each 2 action for you. Using items('Apply_to_each') under apply to each will return the information of the current row and its data The type is object and cannot be used in apply to each 2 action. If you just want to output the email address in your multi-select person column as a string, in order to avoid automatically adding apply to each, you need to write the formula item()?['Email'].

    vdezhilimsft_0-1679036581424.png

    vdezhilimsft_1-1679036658237.png

    vdezhilimsft_2-1679036710024.png

     

    Best Regards,

    Dezhi

     

     

     

  • Jcourtney1485 Profile Picture
    73 on at

    @v-dezhili-msft @Thanks I will try this out. 

  • Verified answer
    Jcourtney1485 Profile Picture
    73 on at

    @v-dezhili-msft  I figured it out. I had to end up changing the out put for both applies to "Value of "outputs ('Get_MSLevelApprovers')?['body/value']. Kind of weird but it works. 

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 425

#2
11manish Profile Picture

11manish 323 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 274

Last 30 days Overall leaderboard