Folder assignment with string

Hello i have a for each loop that goes through some files inside some folders. I want to assign a var based on the folder the robot goes into then turn that var into a string that will be printed into a excel sheet. How can i perform this ?

Hi @langsem,

you can use add data row activity inside for each , this will add data into Datatable, then after For each you can use write range to write the values in Excel.

Shubham Pratap

In For Each, how are you getting to folder to access the files? you could you same path right…

I have a variable named folder_path, but need to change this into a string that i will use as display

alrdy done this step :), but need to assign names to the folders. SO if the each loop goes into folder1 to extract pdf i want a variable that assign folder1 = Name1 then paste Name1 into the excel

check this… if this can help you implementing your flow…
Main.xaml (6.0 KB)

Almost the same, but my setup its like this

First i check the main folder
then loop through all folders inside main folder
then i loop through all pdf files inside a folder

So would need to assign that subfolder name to something usefull