Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Send PDF as Email attachment where PDF is screen (without using flow)

(0) ShareShare
ReportReport
Posted on by

Great video by Reza shows the ability to create pdf from screen (works great), but would like to create and have the option to send pdf email to user (clicking on icon).  Reza shows on the video how he does it with a Gallery (send pdf to email), but this show for gallery, but i need it for the screen

 

my code that is not working, and i think because its missing the creation of the PDF from the screen.

 

Office365Outlook.SendEmailV2(User().Email,"Subject","Body of Email",{Attachements:Table({Name:"PDF Timesheet.pdf",ContentBytes:PDF(myscreen)})})

 

has anyone figured this out?

 

or possibly the option to print from the pdf viewer?

Categories:
  • Bonniedog2 Profile Picture
    on at
    Re: Send PDF as Email attachment where PDF is screen (without using flow)

    Just a follow-up question to this - works perfectly, except the PDF sent looks to be twice the height of the screen (set the screen with its own dimensions). Not sure if this is to do with the background PDF printer scaling options that can't change, or if there is anything that can be changed in PowerApps. Just can't see why this is happening. Thanks

  • vandam2 Profile Picture
    on at
    Re: Send PDF as Email attachment where PDF is screen (without using flow)

    one more (probably dumb question), are we able to bring in fields from the form into the body or subject line?

     

    like the title of the form, rather than "Subject", could we add "Subject" & title or something like that?

  • vandam2 Profile Picture
    on at
    Re: Send PDF as Email attachment where PDF is screen (without using flow)

    unbelievable,  works fantastic, that function will be used alot.. 

     

    thank you Warren

  • Verified answer
    WarrenBelz Profile Picture
    148,042 Most Valuable Professional on at
    Re: Send PDF as Email attachment where PDF is screen (without using flow)

    Hi @vandam2 ,

    You just missed one step - you need to use the PDF() function to create a temporary Variable to send as the content

    With(
     {wPDF: PDF(myscreen)},
     Office365Outlook.SendEmailV2(
     User().Email,
     "Subject",
    	 "Body of Email",
     {
     Attachments: 
     {
     Name: "PDF Timesheet.pdf",
     ContentBytes: wPDF
     }
     }
     )
    );

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 770 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 494

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 399