cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RameshMukka
Continued Contributor
Continued Contributor

Multiple List Attachments as Email Attachments show as corrupted files

I am trying to send multiple attachments of SharePoint list item as Email Attachments. I have verified several blog posts and built an array variable. Though flow runs successfully, the attachments in the email are corrupted and dont open. Below are the formulas I tried.

{
  "Name": "@{items('Apply_to_each')?['DisplayName']}",
  "ContentBytes":@{outputs('Get_attachment_content')?['body']?['$content']}
}

RameshMukka_0-1606814116589.pngRameshMukka_1-1606814305291.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
Jay-Encodian
Super User II
Super User II

Hi @RameshMukka 

Just pass the 'Attachment content' property and not the $content value

This should also help if you have issues: https://powerusers.microsoft.com/t5/Webinars-and-Video-Gallery/Add-multiple-attachments-to-an-email-...

If you ever need to get the $content prop from a 'File Content' prop it's best to use the base64() expression

HTH

Jay

View solution in original post

3 REPLIES 3
Jay-Encodian
Super User II
Super User II

Hi @RameshMukka 

Just pass the 'Attachment content' property and not the $content value

This should also help if you have issues: https://powerusers.microsoft.com/t5/Webinars-and-Video-Gallery/Add-multiple-attachments-to-an-email-...

If you ever need to get the $content prop from a 'File Content' prop it's best to use the base64() expression

HTH

Jay

View solution in original post

@Jay-Encodian ,

Woww!! That worked greatly. Thanks a lot. Just wondering why below blog posts talking about other expression which is not working now. Is this something to do with any product changes in recent past?

 

https://powerusers.microsoft.com/t5/General-Power-Automate/Sending-email-with-multiple-attachments-f...

 

https://powerusers.microsoft.com/t5/Building-Flows/Email-attachments-from-Sharepoint-list-using-MS-F... 

 

https://piyushksingh.com/2020/07/17/power-automate-copy-sharepoint-list-attachments/

 

@RameshMukka 

Yes, Microsoft have been changing to OpenApi which alters how base64 values in array variables are handled. That said, the correct way to do this hasn't changed... it just some of the other less reliable approaches don't always work now depending on context.

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.

Top Solution Authors
Users online (1,976)