Hello Lisa,
There are 2 things you to double check. In the this
link, a user had a similar issue. The solution was changing ensuring the "ContentBytes" in the Value property of the "Append to Array" action to be this:
"ContentBytes": "@body('Get_attachment_content').$content"You can check this by clicking the Elipses (...) in the top right corner of the action, and clicking on "Peek Code". If it doesn't have that, then remove the dynamic holder, put your cursor between the quotations marks, click on expression and paste in the following with out the @ :
body('Get_attachment_content').$contentThen click "Ok".
As far as your email, ensure your "Body" field is referencing the trigger action for the "RequestorComments", and not the "Get Attachments" action. The action you want to use for the Body is the same action you use to supply the "Id" field in the "Get Attachments" action, so it would be above that action. "RequestorComments" on the action above should be a string, and a single record, not an array of records.
Please let me know if this helps.
------------------------------
Nick Miller
Premier Field Engineer
Power Platform & SharePoint
------------------------------
Original Message:
Sent: Aug 30, 2021 04:13 PM
From: Lisa White
Subject: Problems sending attachments from SharePoint list in an email: (1) attachments are corrupt; and (2) sends multiple emails based on number of attachments
I am really stuck on this one. Been trying "solutions" from Google searches for about six hours.
Scenario:
I have a Power App that's connected to a SharePoint list. Each list item includes one or more attachments. I have a button in the Power App that launches a Flow. The Flow sends an email with content from one of the SharePoint list fields in the email body and the attachments from the SharePoint list item.
The Flow sends the email with the attachment(s). However:
- The attachments won't open - says they are corrupted. Tested Excel, Word, and PDF files.
- Sends as many emails as there are attachments. For example, if there are three attachments, it sends three identical emails.
Images of Flow attached.
I've seen references to content-type vs content and base64ToBinary expression. But I can't figure out which Flow step these would go in.
Sigh.
------------------------------
Lisa White
Senior IT Specialist
Herndon VA
703-709-7172
------------------------------