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

Sharepoint list attachment to email - Attachments not opening

Good evening all,

 

My Objective: Take the last 7 days worth of document attachments (pdf) and email them out. I seem to "get items", "get attachments", and "get attachment content" correctly. It looks like I make my array and JSON - body('Get_attachment_content')?[$content] - correctly, and my email gets sent out properly. The part that fails is actually opening the attachment in the email. Its not readable. Am I making a simple mistake? Or is it more complicated?

Any suggestions are appreciated. 

Dumante_8-1607568682066.png

 

Dumante_5-1607568519483.png

Dumante_6-1607568585250.png

body('Get_attachment_content')?[$content]

Dumante_7-1607568625905.png

Dumante_3-1607568369972.png

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
sudharsan1985
Solution Sage
Solution Sage

Hi @Dumante 

You have to do a minor change in the action Append to array variable. You have used the below code

body('Get_attachment_content')?[$content]

Try to use the below. You should send the whole attachment content not the $content alone

outputs('Get_attachment_content')?['body']

There are 2 properties returned from the Get attachment content action

  1. $content-type
  2. $content

You have to assign both the properties to the array variable ContentBytes. Try the above solution and let us know the outcome.

 

 

 
Hope it helps, please like it or mark it as a solution if it resolves your clarification or issue
-Sudharsan K...

View solution in original post

2 REPLIES 2
sudharsan1985
Solution Sage
Solution Sage

Hi @Dumante 

You have to do a minor change in the action Append to array variable. You have used the below code

body('Get_attachment_content')?[$content]

Try to use the below. You should send the whole attachment content not the $content alone

outputs('Get_attachment_content')?['body']

There are 2 properties returned from the Get attachment content action

  1. $content-type
  2. $content

You have to assign both the properties to the array variable ContentBytes. Try the above solution and let us know the outcome.

 

 

 
Hope it helps, please like it or mark it as a solution if it resolves your clarification or issue
-Sudharsan K...

View solution in original post

Good morning,

 

Wow fast response. so I changed the expression to from

 

body('Get_attachment_content')?['$content') 

 

to

 

outputs('Get_attachment_content')?['body']

 

 

 

Dumante_0-1607606096988.png

 

and it works now. 

I need to learn the different expressions better.

 

 

 

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,412)