
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?
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']}"
}
}
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.