cancel
Showing results for 
Search instead for 
Did you mean: 

Download File from Link within email and Save that file to SharePoint

A Flow that will automatically open the link within and email and download that file to OneDrive then transfer it to SharePoint or even download it directly to SharePoint.

 

Retrieve PDF from a link in the email and save to SharePoint

Flow Click on Link to download a report

Status: New
Comments
HumbertoCG
New Member

This is a really useful idea.

rlittleton56
New Member

Exactly what I need to do. Hope this happens soon!

markcallen
New Member

This is possible, but you need the 'Premium' licence to make it work. I know, I know, but don't shoot the messenger!

 

1. When a new email arrives (set your params/filters etc.)

2. Html to text on the body of the email

3. Initialize a variable (startIndex) with the expression similar to

indexOf(outputs('Html_to_text')?['body'],'stringToMatchUrlHere')

4. Initialize a second variable (endIndex) with the expression similar to

add(indexOf(outputs('Html_to_text')?['body'],'.pdf'),4)

 

Note the add 4 ( . p d f ) to get to the end of the string (use 5 for .xlsx for example)

 

5. Initialize a final variable (url) with

substring(outputs('Html_to_text')?['body'],variables('startIndex'),sub(variables('endIndex'),variables('startIndex')))

 

You need to adapt the startIndex and endIndex queries to find the start and end of your URL - this will be dependent on your individual use case - have a play to pick the pattern that works for you.

 

6. Use the HTTP "Premium" extension to download the file.

7. Use the download to save to OD/SP etc.