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.
Hi @EFixler ,
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.
The filepath from the trigger output is base64 encoded. So to get just the filepath, you can use the following expression:
What this expression does is:
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.
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.
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?
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?
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.
Check out new user group experience and if you are a leader please create your group
See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.
Many congratulations to the Season 1 2021 Flownaut Crew!
ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.