web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Files will not attach ...
Power Automate
Unanswered

Files will not attach correctly to the Sent Email.

(0) ShareShare
ReportReport
Posted on by 253

Hello, please help,

 

Here is the gist of it; we have a SP list of employees, and a secondary list which contains the (numerous) files for each employee. In other words, there is an employee roster, then there is a sort of 'File Cabinet'.

The end goal of the flow: To input an employee's name and return an email with all files attached under that name.
Progress: I have written the flow, it is manually triggered, requiring you to input the employee's name and their manager's name. It takes this information, and after some variable initialization, compose-select, and compose-item creation, we Set Variables so that we can use them in the Get Items() action.
This is great, it finds the employee files, confirms it by returning the appropriate item count, then uses Get Items(ID) to Get Attachments(). Then For Each(Get Attachment Content). 
The Problem: This is where we run into the problem. I was not sure how to compile the attachments, so I googled for help, and got this answer. ForEach(Get Attachment Content) -> Append to Variable Array.
Great, this makes sense. Problem is, I think there may be some issue with the code, because when I use the output in the email Attachment Content it feeds back a null file (not able to be opened properly); and when it is opened, it's just pages upon pages of code. It seems like it is not able to properly grab the file types or separate them out. Could I get some help or maybe an explanation on how to fix this?

Tmalonson_1-1692720365751.png

Here is the code inside of the Append

 

{
 "name": "@{items('Apply_to_each')?['DisplayName']}",
 "contentBytes": {
 "$content-type": "@{body('Get_attachment_content')?['$content-type']}",
 "$content": "@{body('Get_attachment_content')?['$content']}"
 }
}

 

 

Tmalonson_0-1692720304794.png

 

Categories:
I have the same question (0)
  • Verified answer
    Tmalonson Profile Picture
    253 on at
    Re: Files will not attach correctly to the Sent Email.

    Solution found,
    The issue was within the Send Email (V2)
    The outputs(compose) has to be inserted into the manual code as opposed to the 2 File name/ Attachments format.

    Tmalonson_1-1692731988835.png

     

    Tmalonson_0-1692731941257.png

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 462 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 456 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard