Skip to main content

Notifications

Community site session details

Community site session details

Session Id : FDjYbJcb/n/0GlnyPgdrnS
Power Automate - General Discussion
Answered

Send email with document PDF - attachment is corrupted

Like (6) ShareShare
ReportReport
Posted on 31 Oct 2023 11:27:16 by 57

Hi all,

i'm new user with Power Automate, in the last weeks i created some easy flow and i really appreciate the powerfull of the tool.

Now, i'm banging my head since 12 hours on a flow that produce PDF files from an excel database and Word Template (as mail merge) and send an email with the document produced in PDF.

The document PDF that i write on OneDrive is ok. The attachment is corrupted. 


I read all the topics about this problem and i change many times the configuration but i can't still solve my issue.


Please, help me to undestand what i'm wronging.

 

i attach some pictures of my flow. In the third one, the point the critical configuration.

Thank you very much for you help

  • samyak0721 Profile Picture
    2 on 28 May 2024 at 09:13:03
    Re: Send email with document PDF - attachment is corrupted

    Hi everyone, whenever I'm trying to open my word file (attachment), I'm getting this alert that the file is unreadable and when I click Yes, I get the error shown in second picture, I tried every suggestion shown in the picture and I also tried to use old version of Power automate as well as the latest one, but still I'm facing the same issue. Could you please suggest some ways to resolve this?samyak0721_0-1716887337866.png

    samyak0721_1-1716887353197.png

    samyak0721_2-1716887556700.png

     

  • lmeyer Profile Picture
    4 on 21 May 2024 at 14:28:41
    Re: Send email with document PDF - attachment is corrupted

    I get a wierd file type ~pdf attachment and base64 not decoded correctly to view binary in Outlook the attachment. I think it needs a base64toBinary decoding. Any suggestions? Outlook needs a special conversion since attachment in Outlook are binary.

  • Sztabson Profile Picture
    3 on 21 May 2024 at 13:23:11
    Re: Send email with document PDF - attachment is corrupted

    Thank you so much. I also lost 12 hours on it....

  • SteveD5 Profile Picture
    3 on 10 May 2024 at 13:56:06
    Re: Send email with document PDF - attachment is corrupted

    @jameslu - THANK YOU!! I wasted 2 nights on this problem and was starting to pull my hair out over it. 

     

    I'm reposting the solution that worked for me in hopes more people see this. If you want to continue using the new designer:

     

    1. Switch to details inputs

    2. Remove the quotes around the FileContent

    3. Save and Test

     

    PowerAutomate_EmailAttachment3.png

     

     

    PowerAutomate_EmailAttachment2.png

  • Jepoy18 Profile Picture
    3 on 09 May 2024 at 02:28:43
    Re: Send email with document PDF - attachment is corrupted

    Thank you so much!!

     

    Using the New Designer and removing the double quote on the File Content works like a charm for me! It resolved my issue for the past 2 days!

  • AndresEugenio Profile Picture
    3 on 08 Apr 2024 at 19:57:59
    Re: Send email with document PDF - attachment is corrupted

    Just switched to the old version of the UI and now my pdf is generated OK (before that the pdf was displayed as a blank document although there was info inside, but not renderable), I'm amazed how come this insn't already fixed by MS. Wake up guys it's been 5 months since the posted solution !!!

  • stov1a Profile Picture
    55 on 14 Mar 2024 at 19:29:06
    Re: Send email with document PDF - attachment is corrupted

    You can actually keep the quotations. Just add .pdf after the expression for the file name.

     

    Check out my solution here. 

     

    https://powerusers.microsoft.com/t5/Building-Flows/Need-help-Corrupt-PDF-attachment-and-Blank-List-Items/m-p/2644459#M296472

  • lmeyer Profile Picture
    4 on 11 Mar 2024 at 22:53:29
    Re: Send email with document PDF - attachment is corrupted

    lmeyer_0-1710197564472.png

    Hi all, I tried switching to classic and didn't work. It still is corrupt. I don't see Content Bytes either. What am I missing and/doing wrong to not see content bytes?

     

    All the best,

    Lori

  • stov1a Profile Picture
    55 on 07 Mar 2024 at 07:22:35
    Re: Send email with document PDF - attachment is corrupted

     

    Here is what it looks like.

  • stov1a Profile Picture
    55 on 07 Mar 2024 at 07:01:24
    Re: Send email with document PDF - attachment is corrupted

    Thanks for the response. Unfortunately, it did not work. I am using the classic editor. When i delete the quotations it just replaces them. The file attached is still not a PDF and can not be previewed.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,660 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard
Loading started