Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Email attachment decoding?

(0) ShareShare
ReportReport
Posted on by 5

I have a really simple flow that takes an email attachment and sends an HTTP POST with the attachment contents in the body. 

ms_admin_0-1595279575436.png

 

The email attachment is a simple text file that just says the word "test"

Why do the contents come through like below?

 

image.png

If I don't use a string variable and simple send "Attachment Contents" in the HTTP body, it comes through just as strange

image.png

What is the proper way to use text attachment contents in a flow without the encoding messed with? Thanks a ton, 

  • ms_admin Profile Picture
    5 on at
    Re: Email attachment decoding?

    Thank you so much, this helped.

     

    It also turned out an image in my signature was being sent as an attachment while testing making things even more confusing. 

  • Verified answer
    v-litu-msft Profile Picture
    on at
    Re: Email attachment decoding?

    Hi @ms_admin,

     

    The content of the received attachment is base64 code, if you want it to display readable, you could use the base64ToString() function convert it into string, for example:

    base64ToString(outputs('Get_Attachment_(V2)')?['body/contentBytes'])

    Annotation 2020-07-21 162027.jpg

     

    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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1