Download file with latest date

Hi,

Anyone can help me on this? I will need to download the latest file on daily basis, how can i do it with UiPath?
Thank you!

Hi @Joanna2 ,
You can get only yyyy-mm-dd in name of them
then convert to datetime
compare date to get newest
Cdate(“ yyyy-mm-dd”) > Cdate(“ yyyy-mm-dd”)
->return true/flase
regards,

@Joanna2

Looks like the date is always today or the previous day

You can check for selector with variable in innertext and pass todays date and yesterdays date to it… if todays fails then yesterdays

Selector will be like this

<webctrl tag='DIV' innertext='{{dateVar}}' />

Datevar = "businessdate=" + Now.ToString("yyyy-MM-dd")

You can use check app state to check if this exists if it does not exists then can check for day -1

Datevar = "businessdate=" + Now.AddDays(-1).ToString("yyyy-MM-dd")

Cheers

hi,@Joanna2

Directory.Getfiles(Varible of folderPath).OderByDescending(function(f) new FileInfo(f).creationTime).First