EDIT:
After some more searching, l I figured out the issue with the help of this video: https://powerusers.microsoft.com/t5/Webinars-and-Video-Gallery/Add-multiple-attachments-to-an-email-...
Essentially, "ContentBytes" is actually built up of two parts: "$content-type" and "$content". The "Content Bytes" Dynamic Content output from "Get Attachments (V2)" action is actually only the $content portion, so it's missing the $content-type.
I resolved this by just editing the "Append to array" to include both those pieces.
Here's what I did:
Now when I send the emails, the PDF attachments work as expected.
---------------------------------------------------------------------------------------------
Hi,
I'm building a flow where I have an incoming email with multiple PDF attachments. I'm taking those PDFs and then organizing them by who they need to be forwarded to. For example, PDF1 and PDF2 go to Person1@email.com and PDF3 and PDF4 go to Person2@email.com. So the Flow does a Send Email action for each group of PDFs to the specific person. There's no issue here.
The problem I'm running into is after the emails are sent, the PDF attachments in those emails are corrupted.
Here's a simplified version of what I'm doing.
So in the above Flow, it's taking each attachment and appending to the PDFArray its Name and ContentBytes.
Then, It's sending an email with the array as an Attachment.
The email is sent successfully. In the email, the attachments have the correct file name and file size, but trying to open one gives a "Adobe Acrobat could not open XXX because it is either not supported or...." error.
I've compared the ContentBytes of the original attachment(s) to what is appended to the PDFarray and they are exactly the same.
Anyone know what I might be doing wrong?
Solved! Go to Solution.
Hi @Cayshin
Yes, the Value content of Append to array variable should be as below:
Thanks for your posting here and sharing the solution in the forum as it would be helpful to anyone who encounters similar issues.
Best Regards.
Hi
Json code is case sensitive. That could be your error. Try using "name" and "contentBytes" in your array variable.
Also, I had some issues when I ran a flow using the test flow option (flow that involves PDFs). Could you try running a flow from scratch?
Regards
JP
Hi @Cayshin
Yes, the Value content of Append to array variable should be as below:
Thanks for your posting here and sharing the solution in the forum as it would be helpful to anyone who encounters similar issues.
Best Regards.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Announcing a new way to share your feedback with the Power Automate Team.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
72 | |
27 | |
22 | |
15 | |
13 |
User | Count |
---|---|
140 | |
42 | |
42 | |
35 | |
30 |