How to open a downloaded folder that has a different version ("Folder Name (3)" or "Folder Name (4)")

When I download a folder from SharePoint in Chrome, it adds a version number to the folder name. After downloading the folder, I want to move each file from this folder into a folder on my desktop. I don’t know what to use for the downloaded folders filepath, since there is a different version number each time it is run. I tried using a wildcard, but i don’t think this is supported. I saw a few solutions using the Assign variable, but I am using StudioX.

image

Hello, try use “Contains”, if the folder “Contains” the static name, hope this works

@bot82

It’s not the version number but if there is any file already exists and you are downloading the same filename chrome will automatically add (1) (2) etc., to that file.

You can avoid this when you are downloading a file rename the file which makes unique

Hope this may help you

Thanks

I would rename the file, but I’m not sure how to locate the file to rename it.

The bot navigates to a SharePoint site and downloads a folder. The bot downloads the same folder every time it is run (because new files are always being added/updated), so it will always be a duplicate filename and have some number added to the end. I don’t think I can change the downloaded folder name, but once it is downloaded how would I change the name if I can’t tell the bot the folderpath before the name change?

@bot82

Create a variable as below

str_filepath = Directory.GetFiles(yourfolder_path,"*.zip").OrderByDescending(Function(d) New FileInfo(d).CreationTime).Tolist(0)

This will fetch the latest file

Hope this may help you

Thanks

I thought about downloading each individual file instead of the whole folder, but I would have the same issue where each time the bot is run it would add a number at the end of the file name.

I don’t think I can create variables using StuidoX 2020.4.3.

It looks like creating variables is available in a later StudioX version (UI Automation), but I need an alternate solution until my company upgrades.

Hi @bot82 …Could you please share the screenshot of the workflow?

Yes, “Save for Later” variable is only available from 2020.10 version.

So you are trying to rename the file before it downaloads??? of after?

If before/after - how you would like to rename those files??

Here is the workflow. I decided to add in a delete file activity right after it is downloaded and the files are extracted, this way it would not add a version number onto the file name. I think this is a good workaround before my company upgrades to 2020.10. Thanks for the help!