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.
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.
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.
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.
Once you click on the Test, it will open the Test Flow window. Select I’ll perform the trigger action >> Save & Test >> Run Flow.
Now, Open SharePoint Online library and add or upload a new file to test the flow with SharePoint.
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:
Now, Open Outlook.com, and here you can see the mail that you received when you added a new file in the SharePoint library.
Read Unable to process template language expressions in action Power Automate
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.
From Choose an action >> Search Send an email (V2), then click on it to add in the flow.
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.
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.
Now, Sign in with another user (Nancy@***) in the SharePoint Online library and add a new file to test the flow with SharePoint.
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:
Here, you can see the user Nancy@**** who added a new file in the SharePoint library, has received an email in Office 365 Outlook.
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.
Read Power Automate update SharePoint list item
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.
Then, Flow run failed.
You will get a error message >> Action ‘Send_an_email_notification_(V3)’ failed.
Click on Edit to edit the Flow.
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.
Now, you can see the Flow ran successfully in the below screenshot:
You may like following Microsoft flow tutorials:
- Microsoft Flow or PowerAutomate Example: Save my email attachments to a SharePoint document library
- Convert SharePoint document to PDF using Power Automate
- Convert SharePoint list item to PDF using Flow or Power Automate
- Convert Email to PDF using Microsoft flow or Power Automate
- Saving microphone audio recorded in PowerApps to SharePoint online
- Microsoft Flow or PowerAutomate: Trigger email based on user input
- Get a push notification when a new file is added to OneDrive for Business (Power Automate
- Save Twitter Tweets in SharePoint Online list using Microsoft Flow
- Get daily weather reports delivered to your email and phone using Power Automate
- Send myself a reminder in 10 minutes in Power Automate
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
Bhawana Rathore is a Microsoft MVP (3 times in Office Apps & Services) and a passionate SharePoint Consultant, having around 10 years of IT experience in the industry, as well as in .Net technologies. She likes to share her technical expertise in EnjoySharePoint.com and SPGuides.com
Is this a free flow with E3 licensev?