Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Answered

Action 'Apply_to_each' failed

(0) ShareShare
ReportReport
Posted on by 1

Hi all, 

 

I would greatly appreciate some help with a simple flow that has been running into:

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

 

The flow is to automate saving the attachments of 4 emails from the same recipient to a SharePoint site.

  • Verified answer
    v-yujincui-msft Profile Picture
    on at
    Re: Action 'Apply_to_each' failed

    Hi @rmyi ,

     

    Could you please share a screenshot of your flow setup ? That will make it much easier to assist.

     

    If you want to save multiple attachments from the mail into SharePoint Document Library, maybe you could try as follows:

    vyujincuimsft_0-1656918943061.png

    If the mail already exists in the inbox, maybe you could try as follows:

    vyujincuimsft_1-1656919233553.png

    vyujincuimsft_2-1656919275152.png

    In addition, here are some links for your reference.

    https://powerusers.microsoft.com/t5/Building-Flows/Downloaded-Attachments-from-Email-are-Broken/m-p/1579536#M176516

    https://powerusers.microsoft.com/t5/Building-Flows/How-to-save-multiple-different-types-of-attachments-from-the/m-p/1564227#M174814

     

     

    Best Regards,
    Charlie Choi

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,603 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,946 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow