Recently, I have been working on a Leave request application, which I need when a new leave request is added to the SharePoint list send an email to the requested with an attachment using Power Automate.
In this Power Automate tutorial, I will explain how to send an email with an attachment from a SharePoint list in Power Automate.
Send an Email With Attachment From SharePoint List using Power Automate
To do this, I created a SharePoint list using the below column and data types for this example.

Let’s follow the below steps:
1. Navigate to the Power Automate Home page, click + Create, select the Automated cloud flow, provide the flow name, choose the flow trigger (When an item is created), and click the Create button. Then, Provide the Site Address and List Name inside the trigger.

2. I will take the Initialize variable action to store the attachments. To do this, provide the below Parameters as it is:
- Name: varAttchments
- Type: Select Array from the drop-down
Here, I changed the action name Initialize variable to Initialize variable | var Attachments.

3. Next, add the ‘Get attachments‘ action and provide the below parameters:
- Site Address: Select a specific SharePoint site from drop-down.
- List Name: Choose a particular list.
- Id: Select Id from dynamic content under When an item is created.

4. After that, take the Get attachment content action to retrieve the details from the attachment. Then, Provide the below parameters:
- Site Address: Select a specific SharePoint site from drop-down.
- List Name: Choose a particular list.
- Id: Select Id from dynamic content under When an item is created.
- File Identifier: Take Id from the dynamic content of Get attachments.
You can see that a For each loop will be added automatically, taking Body outputs from Get attachments.

5. Then, add Append to array variable action inside the loop, and set the below details:
- Name: Select the name from the drop-down.
- Value: Insert the below given code.
{
"name": "@{item()?['DisplayName']}",
"contentBytes": {
"$content-type": "@{body('Get_attachment_content')?['$content-type']}",
"$content": "@{body('Get_attachment_content')?['$content']}"
}
}
6. Finally, add Send an email(v2) action outside of the loop. Set the required parameters:
- To: Select Employee Name Email from dynamic content under When an item is created.
- Subject: Provide a subject line for a mail.
- Body: Provide a detailed description of a mail.
Then, click Show all to display the advanced parameters.
- Attachments: Add attachments variable from dynamic content.

Once the Flow is ready, we will move forward to run the Flow.
Run the Flow to Send an Email With an Attachment From the SharePoint List
Now, it’s time to save the flow. Click on Test -> Select Manually. At this step, add an item to the SharePoint list with an attachment.

When the flow runs successfully, it will send an email notification to the provided user with an attachment, as shown in the screenshot below.

This way, we can get attachments from the SharePoint list and send emails using Power Automate.
Action ‘Append_to_array_variable’ failed: Unable to process template language expressions in action Power Automate
After creating the above flow, I checked with various scenarios, and I found that the flow successfully ran when the attachment files like PDF, Excel, Word document, jpg, or PNG, but when I try with a text file, it gives me an error like below:
Action ‘Append_to_array_variable’ failed: Unable to process template language expressions in action ‘Append_to_array_variable’ inputs at line ‘0’ and column ‘0’: ‘The template language expression ‘body(‘Get_attachment_content)?[‘$content-type’]’ cannot be evaluated because property ‘$content-type’ cannot be selected. Property selection is not supported on values of type ‘String’. Please see https://aka.ms/logicexpressions for usage details.’

[Solved] Action ‘Append_to_array_variable’ failed: Unable to process template language expressions in action Power Automate
To solve this error:
Open the Append to array variable action inside the loop, and set the below details:
- Name: Select the name from the drop-down.
- Value: Insert the below given code.
{
"Name": "@{items('For_each')?['DisplayName']}",
"ContentBytes": "@{body('Get_attachment_content')}"
}
After that, save the flow and now add the item to the sharepoint list with a text file attachment. Then, you can see the flow run successfully and see it in the email with a text file.
![Solved Action Append to array variable failed Unable to process template language expressions in action Power Automate 1 [Solved] Action 'Append_to_array_variable' failed Unable to process template language expressions in action Power Automate](https://www.enjoysharepoint.com/wp-content/uploads/2024/08/Solved-Action-Append_to_array_variable-failed-Unable-to-process-template-language-expressions-in-action-Power-Automate-1.jpg)
Conclusion
I trust this Power Automate tutorial gave you an idea of how to send an email with an attachment from a SharePoint list.
Also, you may like:
- Send an Approval Request With an Attachment Using Power Automate
- Save Office 365 Email Attachments to OneDrive for business using Power Automate
- How to Save Email Attachment to SharePoint using Power Automate?
- Add Attachments to SharePoint List Items using Power Automate [3 Different examples]

After working for more than 18 years in Microsoft technologies like SharePoint, Microsoft 365, and Power Platform (Power Apps, Power Automate, and Power BI), I thought will share my SharePoint expertise knowledge with the world. Our audiences are from the United States, Canada, the United Kingdom, Australia, New Zealand, etc. For my expertise knowledge and SharePoint tutorials, Microsoft has been awarded a Microsoft SharePoint MVP (12 times). I have also worked in companies like HP, TCS, KPIT, etc.
Hi Bijay,
This flow is working but attachments are not opening post mail is sent
Any reply on this?
I am facing the same issue
i am also facing this issue
please provide the solution
Is there a way to use “Send an email notification (V3)” ? This would be preferable as the automated emails do not come from my email account.
Hi, So I have a reminder flow that loops through a list and gets the reminder date which then sends a mail. How do I send singular attachment from a single row in the list since I used a “get items” action rather than “get item”, “get items” tend to loop and fetch all attachments from the list and send in the emails that come. I’m trying to send an attachment per row and not all the attachments within all the lists.
For the folks seeing issues using the attachments in approval workflows, use the following while constructing the arrary
{
“content”: {
“$content-type”: “@{body(‘Get_attachment_content’)[‘$content-type’]}”,
“$content”: “@{body(‘Get_attachment_content’)[‘$content’]}”
},
“Name”: “@{items(‘Build_Attachment_array’)?[‘DisplayName’]}”
}
Reference: https://powerusers.microsoft.com/t5/Building-Flows/The-request-content-was-invalid-and-could-not-be-deserialized/td-p/737581
it worked for me, thanks for great explanation
Great explanation, very appreciated.
I used the same logic to attach documents from OneDrive, but instead of single email the emails being sent is directly proportional to the number of attachments. Can someone help me here?