How to loop through next sub folder after reading files from the previous sub folder in a main folder?

Hi All,

I have two sub folders in a main folder. In each sub folder we have some files. We are trying to build the BOT to loop through each file in each Sub folder one after other. We are looping to first sub folder files successfully but the BOT is not considering the second sub folder.

Please help in me in this regard.

Thanks in advance.

Hi @raju_alakuntla ,

Could you let us know what was the method used ?
Screenshots / Code Snippets of the workflow would be helpful for us to find out the issue at hand.


we are using for each folder in folder.

Can you please suggest any other ways.

@raju_alakuntla ,

If the goal is to process all files present in all sub folders of a Folder then could you try using the For Each File in Folder Activity instead with Include subfolders enabled.
image

Let us know if this is not what you expected.

I tried these two methods but still not triggering the second sub folder

@raju_alakuntla ,

For Each File in Folder will only fetch the files present in all the subfolders. Is it not fetching the required files from all sub folders ? Could you maybe check using a Message Box what are the values that are being fetched ?

Hi,

In a main folder we have 2 sub folders and in each sub folder we have 3 pdf files where we are extracting data. so we are building the bot to extract data from 1st sub folder and 2nd sub folder. can you please suggest the workflow for looping to 1st and 2nd sub folders.

Thanks in advance.
main folder

@raju_alakuntla ,

Could you let us know after data extraction of each pdf file what is the next step that you will be performing ?

Highlighting on the above post once more just to understand if you were able to fetch the files from the sub folders ?

Also, Let us know what is the Folder Path that you have specified in the activity. Is it the Main Folder path or the Sub folder path ?

We are storing the extracted data into an excel file.

I have given Main folder path.

Hello. After selecting Include Subfolders, please use the filter: .
If you use a filter, like .pdf, only the pdf files will be searched.
But if you use a filter for all files (
.*), also folders will be included.
Hope it helps, Adrian