Showing results for 
Search instead for 
Did you mean: 

Adding multiple attachments to the approval email with Power Automate

The approvals action has been very helpful for us, it has helped in designed many scenario's and has made tasks easier.


Recently there has been addition to the approval action card where in we can add attachments to the approvals. When we try to add a single attachment this works fine but when we have multiple attachments this is running into an FOR EACH loop causing the flow to re-run the approval action card multiple times.


Because of this user may receive multiple approval requests to over come this behavior, I have found a way where in we can add multiple attachments to the approval mail and this will not run into a FOR EACH loop. The steps for this are almost the same how we try to add multiple attachments to an email.


Here with I have created a flow with below steps.


The flow is that when an item is created in share point list with multiple attachments, add those attachments and send an approval including them.


Let start by adding a trigger – “When an item is created” and selecting the correct SharePoint Site and List.

Please ensure that you already have SP List created that allows storing multiple attachments on the items in it.

Item creation.JPG







After adding the trigger, we need to fetch all the attachments added to the newly created list item. We should, hence, add the “Get attachments” action. The Site name and List name remain the same from the previous step. We want to then pipe the output “ID” from the trigger, to the input ‘ID’ field.

Attachments action.JPG








Now, that we have a track on all the attachments – we must store these in a single array. Let’s start by initializing an array for the same

initialize array.JPG







Now as we have initialized the array, in the next step we will fetch and store the attachments contents in the array. This is the main step that leads us to adding multiple attachments, so be careful to follow the instructions.

apply to each step.JPG















  • Start by adding a “apply to each loop”, then chose the “body” output from the “Get Attachments”

  • Next add “Get attachment content” action inside the loop. The SP site name and list name don’t change.

    • For the ID field – select ID output from the “When an item is created” trigger

    • For the file identifier field – Select the Id output from the “Get Attachments” action.

  • Next, we want to start adding to the array we just initialized. Set it up as shown below

append to array step.JPG








For reference I am showing the content that I have passed in the Append to array variable step again below.


"Name": Display name for the new file being created,

"Content":"Content of the file"


The content has to be enclosed in doublequotes("). 


Our array, contains the attachment item with two properties – Name and Content. We are assigning the DisplayName, retrieved from “Get Attachments” action to the Name property and the Attachment Content, retrieved from “Get Attachment Contents” action to the Content property.


Now for the final step we need to send the approval email with the attachments array we just constructed.


This step is pretty simple, add an action to send the approval email and pipe in the attachmentArray output to the attachments input field.


approval action.JPG

















That's all once you have successfully created and saved your flow, be sure to test it by exercising the trigger you should see an email as shown below in your inbox with multiple attachments send on single approval request.


Final email.JPG



Note: If you getting any error related to attachment content please try converting the content into base64 format using the base64() function in flow.


Hi, I'm using the same flow and got the error message as below, what could I do to solve this, I saw your note, but don't know how to solve...thanks. 



@VswaldBCould you please enclose the content that you are passing in the base64() function.

That will help you over come the error

I ran into the same problem and solved it in Flow by enclosing the Get attachment function in the base64() function.


I used this expression: base64('Get_attachment_content').


This will continue the flow and add attachments to the approval. However, the attachments cannot be opened as it seems that the content is not properly transferred.


The string after content looks like this:


and is identical for all attachments while the name changes.


Consequently, I get an Email that shows the correct file names but when I try to open them an error is returned from Excel, Word, PPT that the file is corrupt.


Any hint what I am doing wrong?



Lieber Oliver, @Oliver_Germany 


I somehow got it right...I will share my flow screen below just for your reference. 

I think the important thing is to correctly append your array variables and you have to type in the name and content part. hope this could help. 




Dear VswaldB,


Would you mind to share the expression you entered into the ContentBytes section?





It's the dynamic content of the previous step of "get attachment content".


Make sure you get the "Body" from the step "get attachments". 


And in Email, you set the last feature "Use only html message" to "Yes"




Thanks for the help.


I noted that this works fine, the problem is caused earlier in the flow.


I have created a form that allows a file upload and these attachments are added to the SP list. 


This part is causing the problem because it only adds the first item again and again.


I have to work on this part to properly cycle through the attachment list and add them to the sharepoint list.

Meet Our Blog Authors
  • Experienced Consultant with a demonstrated history of working in the information technology and services industry. Skilled in Office 365, Azure, SharePoint Online, PowerShell, Nintex, K2, SharePoint Designer workflow automation, PowerApps, Microsoft Flow, PowerShell, Active Directory, Operating Systems, Networking, and JavaScript. Strong consulting professional with a Bachelor of Engineering (B.E.) focused in Information Technology from Mumbai University.
  • Encodian Owner / Founder - Ex Microsoft Consulting Services - Architect / Developer - 20 years in SharePoint - PowerPlatform Fan
  • Cambridge UK Power Platform User Group Leader, Technical evangelist and speaker. Always says yes to coffee! #LetsGetCoffee
  • Passionate #Programmer #SharePoint #SPFx #Office365 #MSFlow | C-sharpCorner MVP | SharePoint StackOverflow, Github, PnP contributor
  • I am building business processes and applications that are easy for users' to stick to, so they can follow and understand them. In overall I transform processes to be more reliable and effortless. I am a proud co-organizer of SharePoint Saturday Warsaw and active community member, blogger and international speaker.