web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Email Notification for...
Power Automate
Unanswered

Email Notification for files added in folder and subfolders

(0) ShareShare
ReportReport
Posted on by

Hi - New to Power Automate

 

I am trying to send an email notification when a file is added to a folder and any subfolders in that directory.

The files are located in OneDrive for Business

 

I can get a notification if it is placed in the main folder or if I designate a subfolder, but I can't seem to get it to work to look at all folders and subfolders in the directory to trigger the notification.

 

I am looking to have the notification indicate the file name and path.

 

Also the path has a lot of misc data preceding the actual location that is not discernable to the user.  It would be nice just to have the path only.

Thank you, 

Categories:
I have the same question (0)
  • ChrisPiasecki Profile Picture
    6,422 Most Valuable Professional on at

    Hi @Anonymous ,

    You just need to specify Include in subfolders. In the below example it will trigger when any file is created in the root or any child subfolders.

     

    Cpiasecki_0-1604027702405.png

     

     

    The filepath from the trigger output is base64 encoded. So to get just the filepath, you can use the following expression:

    last(split(base64ToString(triggerOutputs()?['headers']['x-ms-file-path-encoded']),'root:'))

     

    What this expression does is:

    • Convert the base64 path to a string
    • Does a split function by searching on the word root:, and the output is an array.
    • The last function will take the last element of the array, which will be the rest of the path string after 'root:'.

    In my example, I uploaded a file called 'test.txt' at the path My Files > Subfolder > SecondLevel.
    In the email, the resulting file path from the expression would be '\SubFolder\SecondLevel\test.txt'

    ---

    Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.

  • Community Power Platform Member Profile Picture
    on at

    Thank you for the response.

     

    This seems to get stuck on the first subfolder.  If you have multiple folders, and place the file in any folder below the first the notification runs and indicates a new file was added but the path directs you to the first subfolder, not the correct folder where the file was added.

  • ChrisPiasecki Profile Picture
    6,422 Most Valuable Professional on at

    Hi @Anonymous,

    I am having a bit of trouble visualizing what you mean. Could you post a screenshot of what you are seeing and advise what it should look like? 

  • Community Power Platform Member Profile Picture
    on at

    Awesome! Thanks its working now.

     

    Is there any way to make the email with the path to the One Drive location?

  • ChrisPiasecki Profile Picture
    6,422 Most Valuable Professional on at

    Hi @Anonymous,

    I'm not quite sure I understand. The example I posted sends an email that shows the file path. Is there a different attribute you are referring to, such as the Url to the item? 

  • Community Power Platform Member Profile Picture
    on at

    One more question to ask.  If multiple files are added, can the email notification be sent once with the list of the new files on each line? Right now it send an email for each and every file separately.

  • PowerSurfer Profile Picture
    13 on at

    HI did you find solution to send only one email for multiple upload in folders ? I don't want multiple email for each file. I just want one email regardless of the number of files upload within a folder . 

  • KiranG-id Profile Picture
    2 on at

    HI can anyone suggest , how to get alert from local disk ( d- drive) folder file is modified using power automate

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 378 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 305 Super User 2025 Season 2

#3
Expiscornovus Profile Picture

Expiscornovus 155 Most Valuable Professional

Last 30 days Overall leaderboard