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
Hi,
I couldn't find anything related to "Upload file from URL". Can you give me some scope on your method?
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.
Just extract the link from the email. Like everytime there should be some similarity, like it will always be at same place.
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
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.
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.
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. 🙂