Skip to main content

Notifications

Power Automate - General Discussion
Unanswered

Power automate download file from link in email

(0) ShareShare
ReportReport
Posted on by 4

Hello everyone,
I am a new user of PowerAutomate

I have a question and would appreciate a solution:

 

Every day I receive an email from SMARTSHEET where the email has a link attached to a PDF file, as soon as you click on the link the file is downloaded.
(It is important for me to emphasize that there is no file attached to the email and this cannot be done through the SMARTSHEET)

 

Is there a way to automate that when I receive such an email, the file is downloaded to a folder in sharedrive?

 

 

This is the example of recived email

Netanel_0-1668458452903.png

 

  • Rabihb Profile Picture
    Rabihb 20 on at
    Re: Power automate download file from link in email

    Hi,

    I couldn't find anything related to "Upload file from URL". Can you give me some scope on your method?

  • srduval Profile Picture
    srduval 1,663 on at
    Re: Power automate download file from link in email

    to subsequently save the file to a share drive, assuming you mean a file system on an on-prem server, you can use the file system object. But you will have to have previously established a gateway on the server to connect the cloud to your local file system and granted access to the gateway user account to the share drive you are wanting to save to.  to extract the URL for the file from the body of the email, you'll have to get the email contents/body from the trigger action, which should be in HTML, then with a compose action and the split expression/function on that content where 'A href="' as your delimiter, then in a another compose action you'd take the outputs of the previous compose (in another expression) and select and split the second line. So you would use something like

    split(outputs(compose_1)[1] ,'>') then in another compose you'd grab the first line of that outputs(compose_1)[0] and this should be your URL, assuming the file link is the first URL in the body of the email. This isn't had but it's a lot of steps. You can nest them all together but that gets hard to keep track of what is what.

     

  • Netanel Profile Picture
    Netanel 4 on at
    Re: Power automate download file from link in email

    @Sundeep_Malik 

     

    1. what i need to do with the link ? where to past it?
    2. the link is chang evry email. same domain but diffrente link that connected to other page.
    3. could you please describe what tab should be added in PowerAutomate
  • Sundeep_Malik Profile Picture
    Sundeep_Malik 6,480 on at
    Re: Power automate download file from link in email

    @Netanel 

     

    Just extract the link from the email. Like everytime there should be some similarity, like it will always be at same place.

     

     

  • Netanel Profile Picture
    Netanel 4 on at
    Re: Power automate download file from link in email

    Hi @Sundeep_Malik 

    Thanks for your answer.

    The link is different every email so i dont know what is the link in next email...

     

     

    The file size is always up to 150KB.

    sam format file' same size BUT different link

  • Sundeep_Malik Profile Picture
    Sundeep_Malik 6,480 on at
    Re: Power automate download file from link in email

    Hey @Netanel 

     

    I am not sure there is a sharedrive connector in power automate or not. I tried to search it but didn't find anything.

     

    But there is a way you can download a file from a link, but be careful of the size, I am not sure about the limit either.

     

     

    For the above you can first use one drive action called upload file from url. From this action you will be able to download the file in your one drive. In the url give the url coming from email and in path give the path you want to save it to.

    images~2.png

     

    After this use delay action, to give some time for the file to download.

     

    After that use get file content or get file content using path action.

    small-Screenshot_2021-05-04_at_20_21_02-1~2.jpg

     

    So, I don't know about the sharedrive part, you can follow the approach above to download the file. After that you can perform any action to transfer it to anywhere else.

     

    If this helps you, you can mark this as a solution and if you liked the explanation you can mark it as a solution. 🙂

     

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,508

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,839

Leaderboard