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 / Dynamic Email Attachme...
Power Automate
Answered

Dynamic Email Attachments Encoding Files Incorrectly

(0) ShareShare
ReportReport
Posted on by 6

Hey all,

 

I'm having an issue with a Power Automate flow. I am storing some Base64 data in a SQL table (mainly images and PDFs), and upon request I want items to be attached to an email. Currently this is how I have set up the flow to work.pic1.PNGpic2.PNG

The flow runs without error but when I receive the email the image is corrupted. Using a file to base64 converter I've managed to find the issue. The contents of the attachment are actually just text, and the text is the base64 data I'm trying to send.

 

After converting the JPG to a txt file by renaming it, I see the original base64 data that when converting from base64 to a file gives me the original image. I was wondering how to attach the actual base64 data and get it recognized as such and not as text.

 

EDIT: This seems to be a problem in Power Automate. When I re-created the same app in Azure Logic apps, I don't get the same issue.

Categories:
  • Ellis Karim Profile Picture
    12,377 Super User 2026 Season 2 on at

    Hi @NJF_Downer ,

     

    That's an interesting issue. Can you try the following alternative for the Append to Array action which specifies the 
    content-type and content:

     

    Snag_16ce4411.png

    For more info about this, please see:  📝Best Practices for Formatting File Attachment Arrays in Approvals, Outlook Emails, OneDrive, and SharePoint – Ellis Karim's Blog

     


    Ellis
    ____________________________________
    If I have answered your question, please mark the post as ☑️ Solved.
    If you like my response, please give it a Thumbs Up.
    My Blog Site

  • NJF_Downer Profile Picture
    6 on at

    Hi Ellis,

     

    Gave this a try,

    NJF_Downer_0-1709597983803.png

     

    Ended up with this error:

    The 'inputs.parameters' of workflow operation 'Send_an_email_(V2)' of type 'OpenApiConnection' is not valid. Error details: The API operation 'SendEmailV2' is missing required property 'emailMessage/Attachments/0/ContentBytes'.

    I think the json needs to be as ContentBytes and not content. The interesting issue is that this exact same setup works in Azure Logic Apps but not in Power Automate.

  • Ellis Karim Profile Picture
    12,377 Super User 2026 Season 2 on at

     I pasted the wrong label on the previous image. Here is the update one:

    Snag_16c5630f.png

    Snag_16c59673.png

     

    Although the following should work too:

    snag_224a3c8


    Ellis
    ____________________________________
    If I have answered your question, please mark the post as ☑️ Solved.
    If you like my response, please give it a Thumbs Up.
    My Blog Site

  • Verified answer
    Ellis Karim Profile Picture
    12,377 Super User 2026 Season 2 on at

    Hi @NJF_Downer ,

     

    Try: Use contentBytes and remove the quotation marks for the file_content and file_fullname:

    Snag_16cdf71a.png

    Snag_16ce4411.png


    Ellis
    ____________________________________
    If I have answered your question, please mark the post as ☑️ Solved.
    If you like my response, please give it a Thumbs Up.
    My Blog Site

  • NJF_Downer Profile Picture
    6 on at

    I did a combination of the contentBytes splitting into $content and $contentType, as well as removing quotes. Seemed to have worked. Thanks!

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 289

#2
11manish Profile Picture

11manish 282 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 119

Last 30 days Overall leaderboard