cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
lknudson2
Frequent Visitor

email CDS PDF atachments

I have a CDS custom entity that allows attachments which I use to store PDF docs for associated records.

 

In my PowerApps program upon selection of the CDS record, I show the attached PDF doc to user with the PDFViewer control.  I would like to allow the user to send the PDF attachment shown via Email.

 

Is this possible?

 

Many thanks!

 

Larry

1 ACCEPTED SOLUTION

Accepted Solutions
v-jefferni
Community Support
Community Support

Hi @lknudson2 ,

 

Could you please share more about your scenario? Do you want to send Email to current user of the App with attachment of a PDF file which is shown in the PDF reader control when associated record has been selected? Do all users have the O365 Exchange online license?

 

If all users have the O365 Exchange online license, you could use a Office365Outlook.SendEmail method to let user send an Email to itself with the PDF filed attached.

 

I made a test on my side:

 

  1. Add Office365Outlook connector into data sources.
  2. I added a Dropdown Box named Dropdown1 and set its Items to the Entity which holds the PDF files as attachments.
  3. Using the Pdf Viewer Control, and set its Document property to below and the PDF file is shown in the control

 

First(LookUp(EntityName,FieldName=Dropdown1.Selected.FieldName).'{Attachments}').Value

 

44.jpg

     4. At last, I added a button with its OnSelect set to:

 

Office365Outlook.SendEmailV2(User().Email,"Subject","Body",{Attachments:AddColumns(Dropdown1.Selected.Attachments,"Name", DisplayName, "ContentBytes", Value, "@odata.type", "")})

 

Received an Email with PDF file attachment after clicking the Button:

45.png

 

You could reference to below link to catch the whole steps:

https://powerusers.microsoft.com/t5/Webinars-and-Video-Gallery/Send-email-with-multiple-attachments/...

 

Best regards,
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution  to help the other members find it.

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

2 REPLIES 2
VijayTailor
Resident Rockstar
Resident Rockstar

Hi @lknudson2 ,

Yes is Possible.

Please have a look into the below-mentioned Video URL. for Details regarding how to send a mail with attachment.

https://www.youtube.com/watch?v=Ws6xEr5N1cU

Thanks,
 Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

v-jefferni
Community Support
Community Support

Hi @lknudson2 ,

 

Could you please share more about your scenario? Do you want to send Email to current user of the App with attachment of a PDF file which is shown in the PDF reader control when associated record has been selected? Do all users have the O365 Exchange online license?

 

If all users have the O365 Exchange online license, you could use a Office365Outlook.SendEmail method to let user send an Email to itself with the PDF filed attached.

 

I made a test on my side:

 

  1. Add Office365Outlook connector into data sources.
  2. I added a Dropdown Box named Dropdown1 and set its Items to the Entity which holds the PDF files as attachments.
  3. Using the Pdf Viewer Control, and set its Document property to below and the PDF file is shown in the control

 

First(LookUp(EntityName,FieldName=Dropdown1.Selected.FieldName).'{Attachments}').Value

 

44.jpg

     4. At last, I added a button with its OnSelect set to:

 

Office365Outlook.SendEmailV2(User().Email,"Subject","Body",{Attachments:AddColumns(Dropdown1.Selected.Attachments,"Name", DisplayName, "ContentBytes", Value, "@odata.type", "")})

 

Received an Email with PDF file attachment after clicking the Button:

45.png

 

You could reference to below link to catch the whole steps:

https://powerusers.microsoft.com/t5/Webinars-and-Video-Gallery/Send-email-with-multiple-attachments/...

 

Best regards,
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution  to help the other members find it.

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,003)