Move documents | variable folder path

Hello together,

I want to download a file in my aotomation. This document is then in my download directory. Afterwards this file should be moved to a folder. The path of the folder should be variable. The ending of the path is a number that is stored in a variable. In the loop, each file should be stored in a separate folder.

How can I map this.
Thanks for your help :slight_smile:

HI @paul2

You can try like this

  • Use for each file in folder

  • IF Directory.Exists(β€œYour folder path”)
    true β†’ Do nothing
    False β†’ Use Create folder activity and pass the path.

  • Move file
    Source ->CurrentFile.tostring
    Des-> Newly created path


Hope this heps

Hey @Sudharsan_Ka

Thank you,

but how can I build the destination path with a variable. Say file extension is a number sequence which is stored in a variable.

Sorry I am not clear about this can you elaborate?

You need to save your file like

File_1.xlsx like this and the number should be changed based on the variable right?

Let me try to clarify:

  1. I download a file (PDF or xlsx)
  2. This file is then in the download directory
  3. Moving the file to a specific folder:
    Example: β€œC:\Users\Name\Documents\12345”
    The number in the file path is variable. The whole process is contained in a For each loop.

For example, in a first pass a PDF can be changed to the folder 12345. In a second pass, an xlsx may need to be saved to the 54321 folder

The number is stored in the variable Company

Can you elaborate?

Okay @paul2

How far did you able to finish the workflow?


Hey @Sudharsan_Ka


I have already implemented that a single document is downloaded. Before that, a few more steps are run through in an application. About 100 different pages are called, based on the input of a variable. If for example the number 100 is entered, I get to a page where it can be that I have to download a document (pdf, xlsx) or not. After that, the next number is run through and so on.
This loop has already been implemented. The problem is that the download file must be moved directly to another folder.

For example, if the file of page (100) is downloaded, this file must also be placed in a folder whose path ending must be the number (100). There is a folder structure analogous to the numbers of the online application.

I hope I could clarify it a little