Microsoft Flow or PowerAutomate Example: Send a customized email when a new file is added

In this Microsoft Flow tutorial, We will discuss how we can use the Microsoft Flow Template “Send a customized email when a new file is added”. Also, we will cover these below topics:

  • Flow for Notification to the people who created the file
  • Error: Action ‘Send_an_email_notification_(V3)’ failed

Send a customized email when a new file is added

In this example, we will see how to create a flow that will trigger, when a new file is added to the SharePoint library, send a customized email to who created the flow.

Here, we will use a flow template “Send a customized email when a new file is added to create the flow.

  • To create a Microsoft Flow, First of all, Sign in your Microsoft Office 365 account, then go to “App launcher” and then click on “Power Automate“.
  • Go to the Templates option in the left navigation and search for “Send a customized email when a new file is added”.

Click on “Send a customized email when a new file is added” template.

Send a customized email when a new file is added
Send a customized email when a new file is added

Here you need to provide your SharePoint, Office 365 Outlook, and Office 365 Users credentials, basically, you need to create the connection.

Click on Continue.

Send a customized email when a new file is added microsoft flow
Send a customized email when a new file is added microsoft flow

Once the flow will open, In the When a file is created (properties only) trigger you can set the below fields:

  • Site Address: Select the SharePoint Site Address from the drop-down list.
  • Library Name: Select the Library Name from the drop-down list.
  • Folder: Select the SharePoint folder or you can leave blank.
Microsoft Flow example
Send a customized email when a new file is added power automate

In the Get my profile (V2) action, you can give the selected fields with a separated comma like name, mail, surname, jobTitle, etc.

Get my profile (V2): Retrieves the profile of the current user who created the flow. 

GivenName: The first name of the user.

Mail: The user’s email address.

In the next action of the flow Send an email, provide the below fields:

  • To: Click on the field >> Go to Dynamic content >> Select Mail.
  • Subject: Provide the subject of the mail, then click on the field >> Go to Dynamic content >> Select Filename with extension.
  • Body: Give the format of the mail which you will receive when a new file is added in the SharePoint library. You can set the format of the mail body, by using these Dynamic content as below:
    • Given Name: Display the first name of the user in the mail.
    • Created By DisplayName: Display the name of the person who added the file in SharePoint.
    • Link to item: Gives the hyperlink to the file.
    • Filename with extension: Display the filename with the extension.

Click on Save >> Test.

Power automate example
Microsoft flow Send a customized email when a new file is added

Once you click on the Test, it will open the Test Flow window. Select I’ll perform the trigger action >> Save & Test >> Run Flow.

Send a customized email when a new file is added example flow
Power Automate Send a customized email when a new file is added

Now, Open SharePoint Online library and add or upload a new file to test the flow with SharePoint.

Send a customized email when a new file is added flow template
Microsoft flow example Send a customized email when a new file is added

Once the Flow ran successfully, you can see the status now becomes as “Your flow ran successfully” like below. All the steps completed successfully will be notified in green tick mark like below:

Power automate flow example
Power Automate example Send a customized email when a new file is added

Now, Open Outlook.com, and here you can see the mail that you received when you added a new file in the SharePoint library.

Send a customized email when a new file is added ms flow template
Send a customized email when a new file is added

Flow for Notification to the people who created the file

If you also want to notify the person who added a new file in the SharePoint library, then follow the below steps:

All the steps are same as above, only you have to add one more action in the Workflow i.e Send an email (V2).

Click on New Step to choose an action in the flow.

Send a customized email when a new file is added in flow
Send a customized email when a new file is added microsoft flow

From Choose an action >> Search Send an email (V2), then click on it to add in the flow.

Send a customized email when a new file is added in ms flow
Send a customized email when a new file is added power automate

In Send an email (V2) action, have the below fields:

  • To: Click on the field >>Go to Dynamic content >> Select Created By Email.
  • Subject: Give the subject to the mail.
  • Body: Give the format of the mail that the user will receive, who will add a new file in the SharePoint library.
Send a customized email when a new file is added
Microsoft flow Send a customized email when a new file is added

Here, you can see the full structure of the Microsoft flow template (Send a customized email when a new file is added). Once all things will over, Click on “Save“. Now click on “Flow Checker” whether there is an error or not and if not, then “Test” the flow.

Example of Power Automate Send a customized email when a new file is added
Power Automate Send a customized email when a new file is added

Now, Sign in with another user ([email protected]***) in the SharePoint Online library and add a new file to test the flow with SharePoint.

Send a customized email when a new file is added template
Microsoft flow example Send a customized email when a new file is added

Once the Flow ran successfully, you can see the status now becomes as “Your flow ran successfully” like below. All the steps completed successfully will be notified in green tick mark like below:

Send a customized email when a new file is added
Power Automate example Send a customized email when a new file is added

Here, you can see the user [email protected]**** who added a new file in the SharePoint library, has received an email in Office 365 Outlook.

Send a customized email when a new file is added template
Send a customized email when a new file is added

Also, you can see the user who created the flow is also notified by an email, that another user has added a new file in the SharePoint library.

Flow for Notification to the people who created the file
Send a customized email when a new file is added microsoft flow

Error: Action ‘Send_an_email_notification_(V3)’ failed

In the Send an email notification (V3) action, if you selected the Created By from the Dynamic content.

Error: Action 'Send_an_email_notification_(V3)' failed
Error: Action ‘Send_an_email_notification_(V3)’ failed

Then, Flow run failed.

You will get a error message >> Action ‘Send_an_email_notification_(V3)’ failed.

Click on Edit to edit the Flow.

Action 'Send_an_email_notification_(V3)' failed
Error: Action ‘Send_an_email_notification_(V3)’ failed

Once the flow will open, In the Send an email notification (V3) action edit the below field:

  • To: In the To field, instead of Created By select Created By Email to send the notification mail to the person who has added a new file in the SharePoint Library.
Action 'Send_an_email_notification_(V3)' failed
Error: Action ‘Send_an_email_notification_(V3)’ failed

Now, you can see the Flow ran successfully in the below screenshot:

Action 'Send_an_email_notification_(V3)' failed
Error: Action ‘Send_an_email_notification_(V3)’ failed

You may like following Microsoft flow tutorials:

In this Microsoft Flow tutorial, We discussed how to use the Microsoft Flow Template “Send a customized email when a new file is added“. Also, we covered these below topics:

  • Flow for Notification to the people who created the file
  • Error: Action ‘Send_an_email_notification_(V3)’ failed
>