How to store file names in a UiPath list variable

Hello,

I would like to loop through all the files in a directory, get their names and stock them in a list variable.

What I tried:

  1. Create string variable containing directory path

  2. Place a for each activity where we loop through Directory.GetFiles(directory_path)

  3. How can I store the string values in a list ?

Thank you !

Directory.GetFiles(directory_path).toList
Or a you interested on the filename only without folder info

1 Like

hi thnx for the fast reply. Do I use an assign activity to this ?