web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Save email body and at...
Power Automate
Unanswered

Save email body and attached images as PDF to document library

(0) ShareShare
ReportReport
Posted on by 193

Hello,

I have a flow that saves emails sent to shared mailbox, extracts elements of the email body , creates a file and updates the file properties based off the info we've extracted.

shelleyb_0-1632492767331.png

shelleyb_1-1632492782971.png

 

When we create the file, we have it set to the following:

 

shelleyb_2-1632492904434.png

It saves the body of the email but the attachments are not included.

 

How do I get the email body and attached images to save as PDF file? I think this might be the best solution but open to suggestions.

 

Any help is appreciated 🙂

 

 

Categories:
I have the same question (0)
  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @shelleyb :

    If you need to add the image in the email to the PDF, you need to convert the image to Base64 format.
    I provide a way to add all the pictures to the end of the text:

    vbofengmsft_0-1632720321378.png

    vbofengmsft_1-1632720340424.png

    vbofengmsft_3-1632720412084.png

    vbofengmsft_4-1632720425596.png

    Compose:

    concat('data:',outputs('Get_Attachment_(V2)')?['body/contentType'],';base64,',outputs('Get_Attachment_(V2)')?['body/contentBytes'])

    Compose2:

    concat('<img src="',outputs('Compose'),'">')

    Best Regards,

    Bof

     

     

  • shelleyb Profile Picture
    193 on at

    @v-bofeng-msft thanks for the help, its giving me the following error message:

     

    shelleyb_1-1632731581624.png

     

     

  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @shelleyb :

    Could you please show me your flow?

    Best Regards,

    Bof

  • shelleyb Profile Picture
    193 on at

    shelleyb_1-1632735030111.png

    shelleyb_2-1632735055131.png

     

     

     

     

    shelleyb_3-1632735101579.png

     

     

  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @shelleyb :

    I noticed that your flow is not configured according to the solution I provided. This is the reason for the error.

    vbofengmsft_0-1632791609686.png

    Best Regards,

    Bof

  • shelleyb Profile Picture
    193 on at

    Thanks @v-bofeng-msft must have missed the loop element the first time round, I've set the flow up as you directed but now I have an the following error message

     

    shelleyb_0-1632819413396.png

     

  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @shelleyb :

    It may be that the size of the image exceeds the limit.

    Best Regards,

    Bof

  • shelleyb Profile Picture
    193 on at

    is there a way to compress the image sizes before converting it to pdf without compromising the image? so the size of the image isn't then an issue?

  • Jay50 Profile Picture
    58 on at

    HI @shelleyb ,

     

    Can you please help me with this flow, I have similar requirements,

    want to merge email body and attachments into one pdf, can you please suggest me the flow which can help me to achieve this requirements.

     

    Thanks 

  • shelleyb Profile Picture
    193 on at

    Hi @Jay50 

     

    I've tried a variety of different ways to achieve this - simplest way was using the encodian connector 

    Converting Emails and Attachments to PDF in Power Automate (encodian.com)

    I haven't been able to find a work solution that doesn't use a third party solution unfortunately. 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 484

#2
Valantis Profile Picture

Valantis 477

#3
Haque Profile Picture

Haque 456

Last 30 days Overall leaderboard