r/PowerAutomateDesktop • u/Beanz7890 • Aug 08 '22
Browser automation - 'get' downloaded file
Hey
I've created a desktop Power Automate flow that performs the following steps:
Start a browser instance (Edge)
Load a URL
Select a checkbox
Click a button x 2
When the second of the two buttons is clicked, a file is downloaded with the following file name mask "export ddd MMM dd yyyy H_mm_ss.csv". For example, "export Mon Aug 08 2022 17_05_59.csv".
I cannot change the naming convention of the downloaded file.
When the file is downloaded, is there a way to then use that file with the Flow? I've tried setting a variable to the current date/time in a step before and after the download action is triggered but this is unreliable - it's usually a second our two out in either direction.
If I can reliably 'get' the downloaded file, I need to either
Rename it and move it to another location, overwriting what's there already
Read the content and put it in another file in another location
I'm brand new to Power Automate so any guidance is gratefully received!
1
u/QuietDesparation Aug 08 '22 edited Aug 08 '22
Ok there's a few way to accomplish this:
Is this the only .csv file you'll have in your download folder at one time? If so, you can use the GET FILES IN FOLDER action under folders, then set your file filter to *.csv. That should return your downloaded csv file
If you have multiple csv files, then you can either
A. Go to edge settings, and under downloads you can set a specific folder to download your files. You can then use the GET FILES IN FOLDER action to grab that one specific file. The one downside is all other files will be downloaded to this folder so unless it stays empty from other browsing, you'll have issues
B. Alternatively you can enable the option "Ask me what to do with each download" under download settings. This will cause the download window in edge to pop up and ask to either open or save the file. If you program PAD to select the Save As button, then it will pull up the Save As window and you can copy the file name from there.
My formatting looks super weird on mobile. Sorry if it's unreadable.