Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Answered

Having an issue posting to a Teams channel an Subject and Attachment from email

(0) ShareShare
ReportReport
Posted on by 17

This is the error i am receiving when trying to post a message to a Teams Channel via Flow. I've added Flow to the channel

The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@{triggerBody()?['attachments']}@{triggerBody()?['subject']}' is of type 'String'. The result must be a valid array.
  • dgarcia Profile Picture
    17 on at
    Re: Having an issue posting to a Teams channel an Subject and Attachment from email

    Thank you so much I've upvoted you!

  • Verified answer
    v-litu-msft Profile Picture
    on at
    Re: Having an issue posting to a Teams channel an Subject and Attachment from email

    Hi @dgarcia,

     

    It seems like you put an error expression into the body field within Apply to each action.

    The input if the Apply to each action should be an array, if you want to loop attachments of Email, you should only append Attachments into it.

    If you are not familiar with Apply to each action, please refer to this document:

    https://docs.microsoft.com/en-us/power-automate/apply-to-each

     

    Best Regards,
    Community Support Team _ Lin Tu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow