When you share the file from your One Drive with external users, often is to collaborate during the lifecycle of the document. There are some scenarios where you may want to know when that file is edited. So we have PowerAutomate where you can create a Flow to detect these changes. However, there are some tricks that you need to use in order to detect these changes.
The PowerAutomate flow works with changes on the folders, which forces you to create a folder for the project but if you have 2 or more files inside that folder, it’ll always trigger the flow and send you an email saying the file was changed.
On our example, we’ve placed a file on the root of One Drive and give it of Testing PowerAutomate.docx and that’s the file that we need to receive notifications when there is a change.
- Create an Automated flow and find the One Drive.
- Select the trigger When a file is Modified and select the folder where the file is located.
- Now add a Condition action
- Select File Name and put it is equal to
- Here is the trick, the file comes encoded so we need to decode it in order to have the correct name.
- Click on Add dynamic content and select the expression base64 as shown.
- base64(‘Testing PowerAutomate.docx’)
- From here you get this alert from multiple options, Microsoft Teams, Notification 365, Email. On our scenario, we will use email so search for Send Email.
- Select the Office 365 connected and send the email as you want.
With this little change on your PowerAutomate, you can have alerts set up on your PowerAumate for the files that are really important to be aware of the change or to know if someone edits then.
[…] Setup an alert when a file is edited on OneDrive – SharePoint Tricks […]
I need to trigger a flow when any file in folder is modified . I used a trigger ” when file is modified” but it triggers when file is created as well when file is modified.
I don’t need trigger when file is created , i need trgger only when file is modified.
Thank you for your article, is perfect for me !
The problem is that when I modified once in the file, every 5 to 20 minutes is sent an alert that the file has been modified. The alert is not stop even if no modification were made on file.
Is there any solution for receive the alert only once ?
Thank you !
That’s a nice catch. I would say yes but only for when you edit the file. So on the flow trigger put something like
@not(@contains(triggerOutputs()?['body/Editor/DisplayName'], ‘Megan Brower’))