cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
thewiteam
Regular Visitor

How can I send a link to a onedrive file in an email?

I have a flow that will save file attachments sent to my email in a folder in onedrive. It is also set up to send an email whenever a file is saved in this folder. I want this email notification to have a link to the file in onedrive. Is there a way to do this?

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @thewiteam,

 

Could you please share a screenshot of your flow's configuration?

Do you create two separated flows on your side?

Further, do you want to send an email including the link to a OneDrive file?

 

If you want to send an email including the link to a created OneDrive file, I think the "Create share link" action could achieve your needs. I have made a test on my side and please take a try with the following workaround:

  • Add a "When a new email arrives" trigger, Has Attachment field and Include Attachments field are both set to Yes.
  • Add a "Apply to each" action, input parameter set to Attachments dynamic content of the trigger.
  • Within "Apply to each" action, add a Compose action, Inputs field set to 1. Then add a Parallel branch action, within left branch, add a "Create file" action, specify Folder Path, File Name set to Name dynamic content of the trigger, File Content set to Content dynamic content of the trigger.

         Within right branch of Parallel branch action, add a "When a file is created" trigger, specify Folder value. Add a "Create share link" action, File field set to File identifier dynamic content of the "When a file is created" trigger. Add a "Send an email" action, Body field set to Web URL dynamic content of the "Create share link" action.

 

Image reference:6.JPG

 

7.JPG

The flow works successfully as below:8.JPG

 

9.JPG

 

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
v-xida-msft
Community Support
Community Support

Hi @thewiteam,

 

Could you please share a screenshot of your flow's configuration?

Do you create two separated flows on your side?

Further, do you want to send an email including the link to a OneDrive file?

 

If you want to send an email including the link to a created OneDrive file, I think the "Create share link" action could achieve your needs. I have made a test on my side and please take a try with the following workaround:

  • Add a "When a new email arrives" trigger, Has Attachment field and Include Attachments field are both set to Yes.
  • Add a "Apply to each" action, input parameter set to Attachments dynamic content of the trigger.
  • Within "Apply to each" action, add a Compose action, Inputs field set to 1. Then add a Parallel branch action, within left branch, add a "Create file" action, specify Folder Path, File Name set to Name dynamic content of the trigger, File Content set to Content dynamic content of the trigger.

         Within right branch of Parallel branch action, add a "When a file is created" trigger, specify Folder value. Add a "Create share link" action, File field set to File identifier dynamic content of the "When a file is created" trigger. Add a "Send an email" action, Body field set to Web URL dynamic content of the "Create share link" action.

 

Image reference:6.JPG

 

7.JPG

The flow works successfully as below:8.JPG

 

9.JPG

 

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Thanks for the help!

Anonymous
Not applicable

image.png

 

 

I get this error while trying to run the flow. any help?

Been playing with this for awhile and your solution worked wonderfully. However, can you help with a solution to send the email and include the share link and original subject/body? This is what I have now but it's not linking the original flagged email subject link and body. Any help is much appreciated!

 

2019-05-11 08_44_03-Edit your flow _ Microsoft Flow.png2019-05-11 08_44_25-Edit your flow _ Microsoft Flow.png

Thank you.!

This solution works. 

When is file is created, command has been removed from power automate, but it still works. Thank you.!

Doc_Oct
New Member

How can I embed the link vs having the whole URL show?

PaulMathasaran
Helper I
Helper I

Hi @Doc_Oct ,

 

This post helped me to do that: LINK

 

Hope so this helps.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (1,958)