Hey everyone! I have a worfkflow that runs every 5 minutes, and saves a spreadsheet in a certain folder. How do I make an Excel input that always takes the last spreadsheet saved in this folder? Because I will need to consult this spreadsheet, but always the last one downloaded.
Hi! Vinicius,
Please can you try Windows Automation for this to click on the topmost file.
I don’t understand, would you explain me again?
Hi! Vinicius,
In File Explorer in a windows machine let us assume the latest file is at the top. So it has a fixed position.
Firstly, AutomationEdge has ready Windows GUI Automation actions to capture steps to be performed on a windows application and generate an RPA automation workflow. You can use this. Here is a video with an example for GUI Web+Windows automation - https://youtu.be/XRPFswt4k0A
And here is a playlist for GUI for Web Automation - https://www.youtube.com/playlist?list=PLniM5YriMFVIgkgoKR_APdBplfNP-S5yd
Secondly, is there a way you can identify the excel file by name? Then you can filter the file using the options in the highlighted box below.
Thank you so much Seema!
The second point i can’t doing that, because that’s files is saved after 5 minutes, in another workflow, so the lastest file is always changed. But isn’t there a step so I can identify the last file in the specific folder and then set it to my Microsoft Input Excel? I can retrieve the names of all my files using get files names, but I cannot set just the last one to my excel input.
Hi! Vinicius,
You can use PowerShell or VBScript to find the latest downloaded filename. Concatenate the folder path (of the downloaded file) with the filename to use it in the MS Excel Input step.
Hi! Vinicius,
Here is a sample code:
//Write Powershell script from here
Get the last downloaded file.
$lastDownloadedFile = Get-ChildItem -Path “?{downloadpath}” -File | Sort-Object LastWriteTime -Descending | Select-Object -First 1
Print the file name.
Write-Host “<<>>FieldName::$lastDownloadedFile<<>>”
#Replace downloadpath with path where latest file is download