Hi Community,
I need to automate a process. Below is the story what I need to automate.
When an email is received, inside the e-mail, it contains a "Download" button. I need the automate the process where when the e-mail is received, it automatically download the file within the e-mail by clicking the "Download" button that connects to an url and save the downloaded file in a particular folder.
Any resources/documentation on how to achieve this either through Power Automate or Power Automate Desktop will be great, thank you.
Solved! Go to Solution.
No tips, just the expression:
substring
(
substring(outputs('html'), indexOf(outputs('html'), 'https://api')),
0,
indexOf(substring(outputs('html'), indexOf(outputs('html'), 'https://api')), '"')
)
Result:
Quite an interesting question. Before getting into details, do you have a premium license?
It's straightforward apart from extracting the link from the html. Do you have a sample of the HTML?
You can change the download link to something else if it is confidential.
@Paulie78 I don't know how much I can post on here publicly. But after looking at the html code email, the link is embeded like this below:
originalsrc="https://api.link_exmaple"
and I just need to extra the file from https://api.link_example, which when load the link itself, it will download the file itself.
Downloading the file is as easy as this:
You can then take the HTTP output and do whatever you want with it (save it to a folder). Your challenge is going to be grabbing the URL from the HTML.
I can make an expression that gets the URL from the sample you posted. But it is very unlikely to work when you try it against your own proper example.
@Paulie78 Awesome, this is problem exactly when I will need.
I am thinking the first step of the flow is
1. when the e-mail account receives an email.
2. A condition, if the sender = the particular sender
3. extra the link from the e-mail; which the unique key in the e-mail will be "https://api......"
(the text of https://api is used in that link only, so I just need to create a string that extra the content between the quotation once it finds "https://api"
then the rest of the steps will be what you posted above, I think.
any tips on extracting the link text?
No tips, just the expression:
substring
(
substring(outputs('html'), indexOf(outputs('html'), 'https://api')),
0,
indexOf(substring(outputs('html'), indexOf(outputs('html'), 'https://api')), '"')
)
Result:
the output from the get should be an csv file. But when I attached the "http body" as the attachment in the email, and email myself (just testing if the download file works), it is not a csv file. I think I am doing something wrong from getting the csv file using http call?
Got it working now. I used "Create file" after HTTP and where the input of giving the file name, just have to make sure the file content is correct. So in my case, the "File Name" input needs to be something like "FileName.csv" since it is a csv file.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Announcing a new way to share your feedback with the Power Automate Team.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
72 | |
23 | |
17 | |
17 | |
14 |
User | Count |
---|---|
125 | |
35 | |
30 | |
28 | |
26 |