Iteration in Folder, not picking the Incoming Case after bot has started

Hi All,

I am iterating through for each loop on a folder(Parent) having multiple folders(Child1, Child2 etc) in it.

Scenario:-
I am starting the bot execution through orchestrator in unattended mode at 11:15 IST, and at the time of execution there were only 2 folders in the Parent folder and my bot successfully processed both the cases by 11:23 IST.

Problem:-
While execution there is one more folder(Child 3) which comes in at 11:17 IST in Parent Folder, so ideally it should process the Child 3 case also.
But its not processing the incoming case after the bot has started to run once.

Can you please suggest what i am missing here & provide the inputs for the same.

Thanks
Ronak

May be you are picking up the count of folders and folder names inside the parent folder at the starting stage and then you are adding the new folder.

Try Reassigning the folder count after re-picking the folders after the new folder is added. @ronak_94

Hey @ronak_94,

Are you saying your bot was in the running state and the third folder came in?Or you ran the bot again after the third folder came in.

Correct me if i am wrong.

Use Direcotry.GetDirectories(“Parent Direcotry PAth”) it will give you all the child directory automatically.

Hi,

Yes bot was in the running state while the third folder came in &
I am using the same thing which u suggested to get all the child directory automatically…

Thanks

Hi @HareeshMR,

I am not picking the count of folders, i am just iterating on the parent folder using the Directory.GetDirectories(“Path”).

Just to inform you, I am not adding the folder by myself.
Its the backend process which results in the incoming folder by itself.

Yes, You may be assigning the values to a string array variable right? Then, once the third folder is added by the bot, then use the same assign activity agin to pick the values inside the folder along with the newly added one and skip the first one if it is already processed

In that case you need to re-initialize the directory array by calling the Direcotry.GetDirectories(“Parent Folder Path”)