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 / Using an Array to Send...
Power Automate
Answered

Using an Array to Send an Email with Attachments

(2) ShareShare
ReportReport
Posted on by 26
Hello All,
 
I am trying to use an Array to send and email with attachments. However when I use an Array the attachments fail to open. 
 
I have Initialized a variable Array called - AttachmentsArray
I create a file in Sharepoint, then I update the file properties, then I Get the file content of the updated file.
Then I Append to the Array
{
  "Name": "FMLAN-@{triggerBody()['text']}",
  "ContentBytes": "base64(body('Get_file_content_-_Updated_FMLAN'))"
}
 
(I have tried both this way and not using the base64 and just "ContentBytes": "@{body('Get_file_content_-_Updated_FMLAN')}") both give me the same result.
 
I then use the AttachmentsArray variable in the attachments section of my Send an email (V2) action.
 
When I get the email the file appears to be attached but will not open in Outlook for a preview, it states that it ran into a problem and I need to open it in the desktop application. When I try to do that I get a message that Word found unreadable content.
 
The attachment when I use the array show to be 1MB. However when I directly attach the file not using the array the attachment works and it shows to be 750KB.
 
The attachments works when I use the Get file content Updated FMLAN file content for the content field in the email. 
@{body('Get_file_content_using_path_-_FMLA_Notice')}
 
But I have several documents that may or may not need to be attached to this email based on choices the user makes in my app so I need to use the array to that I can dynamically add them. 
 
Thanks for any help. 
LOA Flow 1.jpg
LOA Flow 3.jpg
LOA Flow 2.jpg
Categories:
I have the same question (0)
  • Verified answer
    MH-01082034-0 Profile Picture
    26 on at
    Found the issue. The ContentBytes had "" around the dynamic value. 
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,969 Moderator on at
     
    Here is a good post on doing what you want.
     
    Check that out and see if that resolves your issue.
     
    If these suggestions help resolve your issue, Please consider Marking the answer as such and also maybe a like.
    Thank you!
     
    Sincerely,
    Michael Gernaey

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 592

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard