Download files based on date

selector
studio
uipath

#1

I guys,

I want to automate a process in which I have to download a bunch of files and store it in a specific folder.

Each day, I access a website in which all the reports are listed in a .tsv format, ordered by date. The thing is, I only want to download the newest file in the list.

I’ve created a process to download all the files I need but I don’t know how to do it dynamically.

Basically, this is my file selector for each file:

<webctrl aaname=‘a_b_c_2019-01-10.tsv’ parentid=‘content’ tag=‘A’ />

As you can see, the file name always has the date associated with it. Is there a way for me to dynamically select the download link based on the aaname and the system’s today date-1 or any other options?

Thank you all in advance.


#2

Hello @Snaitas
Just follow steps
1.use assign activity
Temp = “<webctrl aaname=‘a_b_c_”+now.adddays(-1).tostring(“yyyy-dd-mm”)+".tsv’ parentid=‘content’ tag=‘A’ />"

Use Temp in selector of your current activity.

Ps- Temp is string type of variable

Regards,
Aditya


#3

I got the following error:

“Compiler error(s) encountered processing expression “temp”.
‘temp’ is not declared. It may be inaccessible due to its protection level.”


#4

Click on variable pane and create new variable of string type name that variable “Temp”


#5

Hi,
if u have created the variable and using it in a sub sequence of the same XAML, Try changing the scope of the variable.

Thanks.


#6

“The selector is not valid”

Thanks anyway :’(


#7

Just replaxe (yyyy-dd-mm) to (yyyy-dd-MM)


#8

Hi @Snaitas
Try below selector
"<webctrl aaname='a_b_c_"+now.adddays(-1).tostring("yyyy-MM-dd")+".tsv' parentid='content' tag='A' />"

Regards,
Arivu :slight_smile:


#9

This worked like a charm! Thanks a lot!


#10

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.