Power Automate send an email with an attachment from SharePoint

In this Power Automate tutorial, we will learn how to send an email with an attachment from SharePoint using Microsoft Flow.

So here we will create a Microsoft flow that will send an email to the recipient with the attachment. Let us check out an example on Power Automate send an email with an attachment from SharePoint.

Microsoft Flow send an email with an attachment from SharePoint

Here we will see how to send an email with an attachment to the recipient from SharePoint using Power automate or Microsoft flow.

I have created a Project management list in SharePoint and when a manager creates a new project/item and assigns it to the user with an attached document.

According to the Assigned to field value that person will get an email with all the attachments.

For example, if the XYZ project is assigned to user1, then user 1 will get all the attachments of that project.

Read Power Automate update SharePoint list item

Send an email with an attachment from SharePoint using Power automate

Here we will see what are the steps to send an email with an attachment from SharePoint using Power automate.

Step 1: Create a SharePoint Online list

Here I have created a Project management List in SharePoint Online having 6 columns with the required column type.

Column NameColumn Type
TitleSingle line of Text
Assigned toPerson
Start DateDate and Time
End DateDate and Time
StatusChoice
BudgetCurrency
SharePoint Online list
Power Automate send an email with an attachment from SharePoint
Power Automate send an email with an attachment from SharePoint

Once you create a SharePoint list for Project Management, next we will move to the next step to create a flow.

Step 2: Create a Flow in Power Automate

Now we will create a flow that will send an email with attachments from SharePoint using Power automate.

To create a flow, Login to Power Automate, then click on Create icon from the navigation bar, select Automate cloud flow.

power automate send email with multiple attachments
power automate send email with multiple attachments

Now provide a flow name, then select the trigger “When an item is created” to run the flow.

send email with attachment in power automate
send email with attachment in power automate

Step 3: When an item is created

In this step, we will provide the site address and list name to which you will assign the Project.

Power Automate send an email v2 attachment
Power Automate send an email v2 attachment

In the next step, we will initialize a variable with the type array, to create an array of all attachments.

Step 4: Create a variable that will store an array of all attachments

Now to create a variable, click on the next step, then select initialize variable.

Power Automate send an email v2 attachment
Power Automate send an email v2 attachment

Now, provide the name of the variable”ArrayAttachments”, and type Array. This array variable will use to create an array of all attachments of the newly created item.

microsoft flow send email with multiple attachments
microsoft flow send email with multiple attachments

Next step we will get the list of attachments from the newly created item.

Step 5: Get List attachments

To get all attachments, click on the next step, then select Get attachments.

Power Automate send an email with an attachment from SharePoint
Power Automate send an email with an attachment from SharePoint

Now provide the SharePoint site address, list name, and id from the dynamic content to get all the attachments of the newly created item.

Power Automate send an email with an attachment from SharePoint list
Power Automate send an email with an attachment from SharePoint list

Step 6: Read all attachments content

To read all the attachment contents, click on the next step and then select the Get attachment content.

Power Automate send an email with an attachment from SharePoint list
Power Automate send an email with an attachment from SharePoint list

Now provide the site address, list name, and id from the dynamic content.

In the File identifier, add the id of getting attachments from the dynamic content, after setting the file identifier, Apply to each loop will be added automatically in order to get the attachment content of each file.

send email with attachment in power automate
send email with attachment in power automate

In the next step, we will append the attachment in the array of attachments.

Step 7: Create an array of attachments

To create an array, click on the next step then select Append to array variable action inside the apply to each loop.

flow send multiple attachments on a single email
flow send multiple attachments on a single email

Now select the variable AttachmentArray as the name, which we have created in Step 4.

Then set the value with the below JSON

  • Name: Set the display name from the dynamic content.
  • ContentBytes: Set the attachment content of the Get attachment contents from the dynamic content.
how to automate sending emails with attachments
how to automate sending emails with attachments

Once we get the attachment content and append it to the array, in the next step send the email with the array of attachments.

Also, read, Power Automate Replace

Step 8: Send attachment via email

To send an email, click on add an action and select Send an Email V2 outlook.

Then provide the Email of the recipient i.e. Assigned to Email.

Set the Subject and Body of the Email. Then click on the Show Advanced option.

Power Automate send an email notification attachment
Power Automate send an email notification attachment

Then in the attachment section, click on the icon to switch to the entire array of attachments.

Power Automate send an email notification attachment
Power Automate send an email notification attachment

And then set the value of attachment to the AttachmentArray variable. Also, you can set the importance from low to high.

how to automatically send emails with attachments
how to automatically send emails with attachments

Once your flow is ready, click on the save and test the flow manually by adding an item to the SharePoint Online list.

Step 9: Run the Flow

To run the flow we will add a project/item to the SharePoint list.

So here I have added a project “SharePoint Migration” with attachments and assigned it to user5, so user 5 will get an email.

Power Automate send an email with an attachment from SharePoint list
Power Automate send an email with an attachment from SharePoint list

Now, user5 will get an email with attachments like the below screenshot.

Power Automate send an email with an attachment from SharePoint
Power Automate send an email with an attachment from SharePoint

And also you can check the flow in Power automate, that your flow ran successfully or not.

Power Automate send an email with an attachment from SharePoint
Power Automate send an email with an attachment from SharePoint

In this Power Automate tutorial, we learned how to send an email with attachments from SharePoint using Power Automate or Microsoft flow.

Related Power Automate tutorials:

  • 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

  • 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?

  • >