Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Send file share link via SMTP mail when a file is created in OneDrive

I'm new to Power Automate and I can't figure this out. What I'm trying to do is:


A) When a file is created in OneDrive folder, a share link is created. 

B) Depending on which folder the new file was created, send the file share link via SMTP mail to different receipients.


The issues I'm facing are:

1) My folder in OneDrive is not recognised as folder but as file. When I create an OneDrive step, my folder doesn't show up in that step in [ *Folder -> Show Picker ] but it is available in [ *File -> Show Picker ].

2) How do I pass the share link for this newly created file to be used in mail in latter step? 

3) I'm using [ Switch ] to differentiate folder path with the intention stated in B). As I test my flow, the Case was not triggered because the folder path obtained in the [ Switch ] step was some random characters eg. ahGRD5kJFD and the folder path I specified in [ Case -> *Equals ] is /Root/New Folder




Super User
Super User

You will need something like this logic:



Super User
Super User

For the folder path:


You will see this because the file path is encoded to base64:


Use an expression to see the file folder path by using decodeBase64(FilePath)






This returns the file path as human readable:



Thank you. Using the Substring funstion, I was able to extract only the folder path. 

Thank you. It works smoothly. Do you have any idea why one of my folder is not listed in the first step [When a file is created -> *Folder ]? 

Super User
Super User

>>>Do you have any idea why one of my folder is not listed in the first step [When a file is created -> *Folder ]?

Can you send a screenshot of the trigger action:


In the example above, any file created within the Books folder or any subfolders under Books should trigger the flow.


There are some constraints: Files larger than 50 MB will be skipped and not returned by this trigger. Files moved within OneDrive are not considered new files.


See:  OneDrive for Business When a file is created



File DirectoryFile Directory


The folder I'm intended to use is "Kimeda". 


Folder shown in StepFolder shown in Step


The folder "Kimeda" is not shown in the Step's Picker. 


I tried using other Step previously, couldn't remember what was the Step name, "Kimeda" was available in the Picker but the icon beside it was "File icon" instead of "Folder icon" as shown. 

Super User
Super User

In File Explorer, what status icons are shown for the folder:


Are there any documents within the Kimeda folder?

Another test:  close the flow, re-name the folder to Kimeda1, wait and allow the change to sync, then edit the flow again and see if the folder Kimeda1 appears as a selectable folder.





That folder contains few sub folders and documents. The total folder size is over 50MB.

However the Step trigger is to create a file no larger than 50MB within that folder, so maybe there's a limit to folder size as well?

Helpful resources

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

Users online (1,633)