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 / Action 'Apply_to_each'...
Power Automate
Answered

Action 'Apply_to_each' failed

(0) ShareShare
ReportReport
Posted on by 24

Colleagues,

I get this error when I run my flow: 

Error

Action 'Apply_to_each' failed

Error Details

The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@triggerOutputs()?['body']' is of type 'Object'. The result must be a valid array.

 

My flow is:

lwashaya_0-1660726250973.png

lwashaya_1-1660726268319.png

 

Please assist

Thanks

 

Categories:
I have the same question (0)
  • Mira Ghaly Profile Picture
    11,415 Moderator on at

    @lwashaya 

    Can you share the rest of your flow so that we can assist further?

    I believe you pasted same screenshot twice

     

  • lwashaya Profile Picture
    24 on at

    The rest is this send mail below. I had not included it because the flow fails at apply to each stage

    lwashaya_0-1660727989395.png

     

    Details of the failed stage 

    "Name": @{item()?['DisplayName']}

    “ContentBytes”: base64(body('Get_attachment_content'))

     

  • Mira Ghaly Profile Picture
    11,415 Moderator on at

    @lwashaya 

    Can you share the apply to each part .. I still do not get why it might be failing?

     

  • lwashaya Profile Picture
    24 on at

    lwashaya_0-1660728913264.png

     

  • Verified answer
    Mira Ghaly Profile Picture
    11,415 Moderator on at

    @lwashaya 

     

    This is the only difference on my side , I tried to replicate the same

    {
    "Name": @{items('Apply_to_each')?['DisplayName']},
    "ContentBytes": @{body('Get_attachment_content')}
    }

     

    Mira_Ghaly_0-1660729719981.png

     

  • lwashaya Profile Picture
    24 on at

    @Mira_Ghaly 

    Same error:

    lwashaya_0-1660735450472.png

    lwashaya_1-1660735481708.png

    I am not sure what else to do

     

  • Verified answer
    Mira Ghaly Profile Picture
    11,415 Moderator on at

    @lwashaya

    I think you are referencing something wrong which is trigger outputs which is not correct, I suggest remove the steps add add again and make sure you are looping on the Get attachments not the body from the trigger.

     

  • Verified answer
    lwashaya Profile Picture
    24 on at

    @Mira_Ghaly 

    There must be something wrong with the list. I applied the same to another list and the error did not come. So I will recreate it for the required list. Thanks a lot for your help

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
David_MA Profile Picture

David_MA 223 Super User 2025 Season 2

#2
Expiscornovus Profile Picture

Expiscornovus 205 Most Valuable Professional

#3
harshdeol Profile Picture

harshdeol 167 Moderator

Last 30 days Overall leaderboard