cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

PDFs getting corrupt when sent as an email attachment from a SharePoint List

Hello All,

I have created a flow that would get the PDF from a SharePoint Attachment column and send it as an email attachment.

Whenever I try to open the PDF from the email , it gives me PDF is corrupt error . The PDF opens fine from the SharePoint List

Below is the flow

codrz619_1-1611657861186.png

codrz619_3-1611657957433.png

Under ContentBytes , I have used different expressions as given below however the PDFs are getting corrupted

base64(body('Get_attachment_content'))
base64(body('Get_attachment_content').$content)

I have read all the articles pertaining to the topic , However facing the same issues

Any help would be appreciated @ClavinFernandes  @RezaDorrani @ShaneYoung 
 

Thanks in advance


 

 



1 ACCEPTED SOLUTION

Accepted Solutions
8 REPLIES 8
annajhaveri
Super User
Super User

@Anonymous , please use the Attachments Content directly in the Array as shown in below screenshot

 

annajhaveri_0-1611663447302.png

 

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.
Anonymous
Not applicable

@annajhaveri  Thank you for responding

Have tried this but it fails.

Also tried base64(outputs('Get_file_content')?['body']) , no luck

okay thats strange, i did try using Attachment Content and it worked for me. Can you share screenshot of send email action which shows attachment property. 

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.
Anonymous
Not applicable

I am not sure why PA changes the contentbytes to AttachmentContent as shown below

codrz619_0-1611673129462.png

Even if I change the ContentBytes to expression, it would fail



codrz619_1-1611673327248.png


Also tried base64(outputs('Get_file_content')?['content']) , no luck

It should work with Attachment Content, i tried with Base64 it doesnt work. Are you testing by using Test function from PA, if yes, can you try actually adding new item or editing existing item and test?

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.
Anonymous
Not applicable

I am testing with and without the test option , it still fails

Also the flow triggers for new items only 

Anonymous
Not applicable

@Jay-Encodian Thank you for the help

Would surely check this Tutorial and get back to you 🙂

Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

New Process Advisor Capabilities carousel.png

Read the blog for the latest news

Read the latest about new experiences and capabilities in the Power Automate product blog.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

AI Builder AMA June 7th carousel (up on May 25th, take down June 8th) (1).png

'Ask Microsoft Anything' about AI Builder!

The AI Builder team invite you to ask questions and provide helpful answers at our next AMA.

Users online (1,987)