How to Send an Email When SharePoint File is Modified with Power Automate

Do you want to get notified when your SharePoint file is modified?

Power Automate is a useful tool when it comes to automating repetitive tasks such as sending email notifications. This can include automatically sending an email when a SharePoint file is modified.

This can help keep your team informed about important updates, ensuring that everyone stays on the same page.

This article will guide you through the process of setting up a flow to send an email notification whenever a SharePoint file is updated.

This way, you can stay informed about changes to your documents without constantly monitoring them yourself.

Add When a File is Modified Trigger

To set up an email notification when a SharePoint file is modified using Power Automate, start by adding the When an item or a file is modified trigger. To do this, follow these steps:

  1. Go to the Create tab.
  2. Click on the Automate cloud flow option.
  3. Click on the Skip button to move directly into the flow builder.
  1. Select SharePoint or search for When an item or a file is modified in the search bar.
  1. Select the When an item or a file is modified trigger action.
  1. Select the Site Address of the SharePoint site where you want to be notified of modified files.
  2. Select the library from the List or Library Name field.
  3. Select the Folder where the files you want to be notified about are.

Now that the trigger is set up, it will run for any file within the selected folder. However, you might only want it to run and notify you for a certain file, for a certain user, or for a certain file type.

These conditions can be achieved with trigger conditions.

Add a Trigger Condition to Limit the Flow

This section will discuss how to add trigger conditions in Power Automate to limit your flow. It will cover trigger conditions for a given file, a given user, and a given file type.

This will allow your flow to only execute when the required conditions are met.

Here is how to add a trigger condition to your flow.

  1. Click on the Ellipse icon found in the top right of the trigger.
  2. Select the Settings option from the menu.
  1. Click on the Add button found at the bottom of the settings menu.
  2. Paste your expression in the Trigger Conditions input.
  3. Press the Done button.

This will create an input where you can add your condition expression. The flow will then only run when the expression is evaluated to be true.

📝 Note: The expression must start with the @ character so Power Automate will recognize it as an expression and evaluate it.

Trigger Condition for a Given File

To create a trigger condition for a specific file in SharePoint, you can use the Filename property in the trigger. In the trigger conditions field, add the following expression:

@equals(triggerOutputs()?['body/Title'], 'YourFileName')

Replace YourFileName with the name of the file, you want to monitor. This condition will ensure the flow only triggers when the specified file is modified.

Trigger Condition for a Given User

To create a trigger condition for a specific user, you can use the ModifiedBy property. In the trigger conditions field, add the following expression:

@equals(triggerOutputs()?['body/Editor/Email'], 'user@youremail.com')

Replace user@youremail.com with the email address of the user you want to track. This condition will ensure the flow only triggers when the specified user modifies a file.

Trigger Condition for a Given File Type

To create a trigger condition for a specific file type, you can use the Filename property along with the contains function. In the trigger conditions field, add the following expression:

@endsWith(triggerOutputs()?['body/{FilenameWithExtension}'], '.YourFileType')

Replace YourFileType with the extension of the file type you want to monitor, such as .pdf or .txt. This condition will ensure the flow only triggers when a file of the specified type is modified.

Add the Send an Email Action

After setting up the trigger, you can now proceed to create the actions for sending an email whenever a SharePoint file is modified.

Follow these steps to set up a flow that sends an email when a SharePoint file is modified,

  1. Click on the New step button in the flow builder.
  2. Search for send an email in the search bar.
  3. Select the Send an email action from the Outlook connector.
  4. Add the users to whom you want to notify in the To field.
  5. Add a Subject line to the email action.
  6. Add your Body message to the email action.

Save your flow with the Save button at the top of the flow builder and your notification flow is ready to go!

Now, whenever a file is modified in the specified SharePoint library, Power Automate will automatically send an email notification to the user.

Conclusions

Power Automate provides a trigger to automate email notifications when a SharePoint file is modified.

By setting up a flow that triggers when files are modified, you can keep your team informed and up-to-date on any changes made to critical files.

Remember this will trigger whenever any file in the selected folder is modified unless you create trigger conditions. You can create custom notification conditions upon file modification events. This will help to remove manual monitoring tasks,

Have you tried this notification trigger in SharePoint? Let me know in the comments!

About the Author

John MacDougall

John MacDougall

John is a Microsoft MVP and freelance consultant and trainer specializing in Excel, Power BI, Power Automate, Power Apps and SharePoint. You can find other interesting articles from John on his blog or YouTube channel.

Related Articles

Comments

0 Comments

Get the Latest Tech Tips

Write For Us

Are you a tech enthusiast with a talent for writing great content? Come write for us!

Follow Us

Follow us on social media to stay up to date with the latest in tech!