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 / Send file share link v...
Power Automate
Unanswered

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

(0) ShareShare
ReportReport
Posted on by 12

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

 

 

 

Categories:
I have the same question (0)
  • Ellis Karim Profile Picture
    11,681 Super User 2025 Season 2 on at

    You will need something like this logic:

    ekarim2020_0-1625574836934.png

     

  • Ellis Karim Profile Picture
    11,681 Super User 2025 Season 2 on at

    For the folder path:

    ekarim2020_2-1625575564214.png

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

    ekarim2020_0-1625575490058.png

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

     

     

    decodeBase64(triggerOutputs()?['headers/x-ms-file-path-encoded'])

     

     

    ekarim2020_3-1625575615473.png
    This returns the file path as human readable:
    ekarim2020_1-1625575523415.png

     

    Ellis

  • personalcompute Profile Picture
    12 on at

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

  • personalcompute Profile Picture
    12 on at

    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 ]? 

  • Ellis Karim Profile Picture
    11,681 Super User 2025 Season 2 on at

    >>>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:

    ekarim2020_0-1625646976938.png

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

    ekarim2020_1-1625647231218.png

    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

     

    Ellis

  • personalcompute Profile Picture
    12 on at

    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. 

  • Ellis Karim Profile Picture
    11,681 Super User 2025 Season 2 on at

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

    ekarim2020_0-1625733176256.png

    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.

    Ellis

     

  • personalcompute Profile Picture
    12 on at

    Capture.PNG

     

    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?

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…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard