Download file with dynamic filename

Hi all!

I’ve been playing around a bit, but am struggling to get the following done. I have a file which I’d like to download an a daily base. This file is generated every night and then stored in a cloud drive. The first part of the filename is like “Dummy Name - Group X - 2020-04-08 00_39 CEST.xlsx”. Tomorrow the name will be like “Dummy Name - Group X - 2020-04-09 00_39 CEST.xlsx”. Each new report thus has the data and time of generating this report. How can I make sure UI Path downloads this report based on the first part of the file name. I’ve tried using a fuzzy match, but it doesn’t seem to work.

Any help would be appreciated :slight_smile:

Hey Nipius, I’ve created a video that solves your exact example. Let me know, if that’s what you need :slightly_smiling_face:

1 Like

You can try the below steps.

  1. GetFileName without extension
  2. Check the file name starts with “Dummy Name”
  3. Downlaod the file

Thanks a ton, Anders. Unfortunately, I wasn’t clear in my post that I’m actually referring to a cloud drive on a website. One of our systems allows us to schedule the creation of reports. They are then stored (in the way I described above) on a cloud drive, which you can only access via a browser. I can access this page through a static URL.

I can completely follow your clear instructions, but am not sure how to apply this logic to a URL, rather than a folder on my local machine.

Many thanks for any follow-up instructions. And I’ll definitely check-out all the other extremely useful video’s you’ve created! Really cool stuff :slight_smile:

Thank you :slight_smile: Can you give an example of such a drive on a website? Maybe just another site, that looks like yours.

Sure! Let me know if the below screenshot is of any help :slight_smile:

The URL would be something like this: https://site.com/company/d/task/0123$4567.htmld

Sure, then we first need to download the files, we need:

(1) Datascrape the files (you’ll get all the names into a datatable)
(2) Now I will make a For Each Row and then download each one of the files with a dynamic selector

If you only need one file (like the one from today), then I would apply a filter to the For Each Row.

After that you got the files needed and you could go with the process in my video.

Ps. You could also just download all the files and then apply the ‘today’ filter afterwards as I did it in the video.

1 Like

Apologies for the delayed response. The past two weeks were hectic.

I’ll have a look later this month on how to apply this. Really appreciate the input you’ve provided!

Hi All,

I see that the emphasis here was in a dynamic file name, i am stuck with downloading files with dynamic file types(PDF,Word,xlxs,etc etc).

Anders have a video where he saves/scrape the data and url to excel document, so i went and change that and scrapped a website where i want to download some documents, however those documents are not of simmilar types and at the moment i can only save one type.

I am using DownlodFileActivity i got from managed packages.

I have followed this tutorial download files automatically

Hi @Mokate

When you download the files , the save as dialog box will appear in that below document type will be also mentioned

So since you are downloading many files of different extensions

Try this way

Add the filename only avoiding the type of extension as extension is decided by the option below

for reference see the dialod box below for clarification


Here i am downloading the vendow_master excel sheet so automatically below document type will be also mentioned
So provide the file path as C:\ (some before filepath parts)\vendor_master instead of
C:\ (some before filepath parts)\vendor_master.xlsx

Hope you clarify by this answer

Regards

Nived N

Happy Automation

Hi @NIVED_NAMBIAR,

Not really, your answer did not clarify anything, you see if you follow that video i attached above and i ommit the filetype it will only save a file without a filetype, but the urls/link i am downloading from has the file type

image

Can u show the save as dialog box @Mokate