I have built an app that has a PDF viewer of a gallery item on a screen, I would like to send an attachment on email of the item shown in the PDF viewer. This is the code I use below.
However it is successful and I get an email, with the attachment, but when the attachment is opened I get a black box on the page and not the item record shown in the viewer?
I am not sure where I am going wrong, as I have also tried the container on the home screen that also shows the item and that just provides a completley blank screen?
Office365Outlook.SendEmailV2(User().Email,"Arion Commissioning Tracker Record","PDF From Power Apps",{Attachments:Table({Name:"ArionCommissioningTrackerRecord.pdf",ContentBytes:PDF(PdfViewer2)})})
I don't think you can send the PDF directly as ContentBytes for the file. You need to translate it to Base64 encoded. You can do that using the JSON function. Try the following:
Office365Outlook.SendEmailV2(User().Email,"Arion Commissioning Tracker Record","PDF From Power Apps",{Attachments:Table({Name:"ArionCommissioningTrackerRecord.pdf",ContentBytes:JSON(PDF(PdfViewer2),JSONFormat.IncludeBinaryData)})})
Was this reply helpful?YesNo
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.