In this article, I will walk you through the process of reading a SharePoint List item and its associated attachments, followed by the step-by-step instructions on how to email those attachments using the Send Mail action in Power Automate. By the end of this post, you will have gained the knowledge and skills necessary to effectively read SharePoint List items and send their attachments via email using Power Automate.
What does the flow do?
The flow uses a manual trigger and requests the user to enter a SharePoint List item ID. The file attachments associated with the item ID are then emailed to the user.
The demo SharePoint List I’m using is called Contracts Library as shown below. The list item ID that the user wants to enter when running the flow will be 47.

List item 47 has three file attachments:

When the flow is run the user is requested to enter a List item ID, for example 47:

The flow executes and an email containing three file attachments is sent to the user:

Finally, open each file attachment to ensure that the files are not corrupt and are valid documents:

Here is the flow that we will build
How to Display the ID column
1. Click the Add Column option, then select Show or Hide Columns:

2. Tick the ID column then click Apply. Use the arrows ∧ ∨ to change the ordering of the columns:

Building the flow
1. For this demo we’ll start by creating an Instant cloud flow:

2. The flow will use a manual trigger. Give your flow a name then select the trigger as Manually trigger a flow (1):


3. We want to request that the user enters a SharePoint List item ID number when the flow is run. Open the Manually trigger a flow action and click Add an Input:
Click Number:
Next, change the name of the number field. You can also update the help text to something more meaningful:
4. Add a Get attachments action (2). Select the SharePoint site and List. For the Id select List Item ID from Dynamic content:

5. Add an Initialize variable action (3) of type array:
We will store the content of each attachment in the array variable varAttachmentOutlook.
6. Add an Apply to each loop (4) and set the Get attachments Body (5) as the output from previous step as shown below:

The Apply to each loop will get the content of each attachment and store the attachment content and attachment name in the array variable varAttachmentOutlook.
7. Add a Get attachment content (6) action:

8. For the Id select the List Item ID, and for the File Identifier select the Id (File Identifier) from Get attachments:

9. Next add an Append to Array variable (7) action:

The array variable will store the attachment name (Display Name) and attachment content in a JSON object. Enter the following as shown in the steps below:

Pay attention to the brackets, quotation, colon and comma characters:

Select the Attachment Content and Display Name from dynamic content as shown below:

10. The final action is the send mail action. Add a Send an email (V2) action (8):

11. Select Show advanced options:

12. Next switch the attachments mode to input entire array, then add the attachment array from Dynamic content as shown below:

Trouble shooting
If you find that attachments do not open, see Short Notes: The format of File Attachment Arrays for Approvals and Outlook Emails
If you find that in some instances the above does not work, i.e., the file attachment won’t open, I have included an alternative format for the attachments array.

You can copy-and-paste the following code into the “Append to array variable” action:
{
"name": "@{items('Apply_to_each')?['DisplayName']}",
"contentBytes": {
"$content-type": "@{body('Get_attachment_content')?['$content-type']}",
"$content": "@{body('Get_attachment_content')?['$content']}"
}
}
So, why do different array format work for some people but generate corrupt attachments for others?
Thank you so much for this very detailed tutorial! Its not easy to find such detailed, step by step instructions for Sharepoint beginners like me. Although I wasn’t successful in getting my flow to work, I wanted to thank you for being so thorough.
Hello, many thanks for your detailed description of the flow. I would like to create the flow, but in my additional /separate created approval workflow I used the step “Grant access to an item or folder” and “Stop sharing item / elements or folder”. Do you know if your flow will work in combination with my used steps? Thanks in advance! Best regards Andreas
Hi Xanoxs,
The flow will work with “Grant access to an item or a folder” and “Stop sharing an item or a file”. In that case you can include a link to the item in the approval work flow, and you wont need to send the attachments.
But if you do want to send the list item file attachments in the approval action, then the format of the array will need to change slightly. Replace “ContentBytes” key with “content” in the Append to array variable action:
{
“name”:
“content”:
}
But note that file attachments don’t appear in Teams approvals action that the recipient receives. One day Microsoft will fix this.
Please see:
(1) Best Practices for Formatting File Attachment Arrays in Approvals, Outlook Emails, OneDrive, and SharePoint
https://elliskarim.com/2022/08/15/short-notes-the-format-of-file-attachment-arrays-for-approvals-and-outlook-emails/
and
(2) How to Send Microsoft Forms File Uploads to an Approval Workflow Using Power Automate
https://elliskarim.com/2022/01/17/how-to-send-microsoft-forms-file-uploads-to-an-approval-workflow-using-power-automate/
Ellis