Adding multiple attachments to an approval flow in Power Automate is a common requirement. The method is slightly different between the Create an Approval action and the Send an email(V2) action. I will demonstrate both methods in one flow, using a SharePoint list as an example:
First, create the trigger action and initialize two array variables. There are separate arrays for the email action and the approval action:
Next, use the Get attachments action and provide the same site and list address as before. Use the ID from the trigger action.
Now use the Get attachment Content action and again supply the site and list name. For the ID field use the ID from When an Item is created. Finally, for the File identifier, use the Id from the Get attachments step:
This action will now change to be inside an Apply to Each action.
Fill the arrays with the attachment content
The next step is to populate the arrays with the contents of the attachments. Use the append to Append to array variable action. Here is how to build the approvals attachment array.
The code for the approval attachment array is:
{ "content": { "$content-type": "@{body('Get_attachment_content')['$content-type']}", "$content": "@{body('Get_attachment_content')['$content']}" }, "Name": "@{items('Build_Attachment_array')?['DisplayName']}" }
Now populate the email attachment array:
The code for the email attachment array is:
{ "ContentBytes": { "$content-type": "@{body('Get_attachment_content')['$content-type']}", "$content": "@{body('Get_attachment_content')['$content']}" }, "Name": "@{items('Build_attachment_array')?['DisplayName']}" }
Notice how the required code is slightly different on line two.
Use the arrays as the attachment content
Now you can simply insert these arrays into the “Create an Approval” or “Send an email(V2)” actions.
Here is an image of my entire flow that shows how to send multiple attachments in approvals in a flow from a SharePoint list (click to expand).
Corrupt attachments
Slightly different solutions to this problem have been discussed in the Power Automate forums but for me, they resulted in corrupted attachments. Adding the correct content type for each of the file attachments fixes the corruption.
I also found that sometimes the file size would increase dramatically.
I’d like to understand why the different array format works for some people and generates corrupt attachments for others.