cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ms_admin
New Member

Email attachment decoding?

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, 

1 ACCEPTED SOLUTION

Accepted Solutions
v-litu-msft
Community Support
Community Support

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.

View solution in original post

2 REPLIES 2
v-litu-msft
Community Support
Community Support

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.

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. 

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (1,580)