How can i Extract the entire folder hierarchy

How can i Extract the entire folder hierarchy and files names inside and put it into a excel file ??

Hi @Soudios ,
You can use
to get all sub folder
to get all file
my code
list_file_and_folder.xaml (18.6 KB)
my output
test.xlsx (8.4 KB)

you can edit location write with your requirement
if write in one column is easier



Gives you the entire folders in the main folder

inside use

For each activity inside


assign activity

path.getfilename(currentitem).tostring Gives you the each filename inside all the folders

this is what i need, i don’t need path juste the folder and file name


refer to:

New DirectoryInfo(MyDirPathVar).GetFiles("*.*",SearchOption.AllDirectories)

Each loop write to a column, same my code

you can add title before write, and don’t need +index to write

the format isn’t what i want its not really clear, is it possible to have this format :


yes it can be done

Yes, change index and create column name before write file and folder name

do you have an exemple plz ?

Ok. I will edit with your format, then send to you

You can try
Soudios.xaml (10.7 KB)
edit value of
and where you want to write output

there is 2 xaml files and no invoke activity which one is the good one ?

foldercase.xaml (11.0 KB)
here, you can edit name of column


my ouput

What is the issue ? @Nguyen_Van_Luong1



passing of the variables in the add datarow should be same as the no of columns you have

This information is not fix, it can change, maybe next day a new file can be added


then you need to add another column for that file

as filename4

assign the filename to a variable and pass it to the add datarow

because you have mentioned some fixed column in the excel as your file number

Hope this helps

i found the issue, the folders are in a sharepoint folder so i need to connect to sharepoint first i think


oh ok

if you have any more issues let me know