cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PhilFancy
Advocate I
Advocate I

Get Text File Attachment Content from Shared Mailbox Email

I am struggling with this:

 

Shared Mailbox receives mails with text files (.txt) attached. The flow should start and get the text file content as plain text. 

 

The flow starts with "when a new email arrives in a shared mailbox". This works as expected. 

But I struggle to get the file content of the attachments. I never ever get them as plain text. I just get them kind of encrypted (see yellow marked area - this should be just some numbers in the text file).

PhilFancy_0-1660026648030.png

Tried to use a second step to get the email attachment with the same result. 

Tried to create a SharePoint file with the attachment file content from mail with the same result.

 

Is it possible to get the content of a text file from email attachment?

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
MarconettiMarco
Super User
Super User

Hello @PhilFancy ,

please, after adding the "Get Attachment (V2)" action, add a "Compose" action in which put the following expression:

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

MarconettiMarco_0-1660027666850.png

 

You'll get the txt content, like below:

MarconettiMarco_1-1660027698978.png

 

If I have answered your question, please mark my post as Solved.
If you like my response, please give it a Thumbs Up.

BR,

Marco

 

 

View solution in original post

2 REPLIES 2
MarconettiMarco
Super User
Super User

Hello @PhilFancy ,

please, after adding the "Get Attachment (V2)" action, add a "Compose" action in which put the following expression:

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

MarconettiMarco_0-1660027666850.png

 

You'll get the txt content, like below:

MarconettiMarco_1-1660027698978.png

 

If I have answered your question, please mark my post as Solved.
If you like my response, please give it a Thumbs Up.

BR,

Marco

 

 

PhilFancy
Advocate I
Advocate I

Works like a charm - the decodeBase64 step solved the issue. Thank you Marco! 

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.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (3,306)