I am having issues in using “Wait for Document Validation Action and Resume” with a for loop.
Is there a way to iterate a folder with multiple files without running into this issue? Please see attached image.
Thank you!
@Abi_RPA - You can simulate a loop with the REFramework (https://docs.uipath.com/studio/standalone/2023.4/user-guide/robotic-enterprise-framework) that uses State Machine activities (https://docs.uipath.com/studio/standalone/2023.4/user-guide/state-machines).
Use the modified REFramework in such a way that it does not use Queues but rather Tabular data: ReFramework for Tabular Data - RPA Component | UiPath Marketplace | Overview
I would use the For Each File in Folder in the Initialization State and collect the file paths and store them in an Excel file:

And then proceed as normal in the Get Transaction State, getting the filenames row after row.

And then proces the file in the Process Transaction State where I would make a separate Sequence to be invoked:

Let me know if you have questions on this. ![]()
Hi @Abi_RPA
Instead of using for each file in folder activity store the files in a List Variable. Iterate this List Variable by using for each activity.
FilesList = Directory.Getfiles(“Folder path”)
Which stores the list of files in a specific folder.
Then iterate the FileList Variable by using for each activity.
Inside for each activity try the wait for document validation action and resume activity.
Hope it helps!!
A normal for each will do the job for you…for each activity will support wait activity
So use directory.getfiles("C:\UIPath\Invoices") in assign activity and store the value to array of string type variable
And then use that variable in for loop activity
Cheers
Please use it inside a parallel for each and the issue should be sorted

Or you can implement a loop using workflows and you would not get an error
basically in flow descision you can check int_counter<filelist.Count…so that the loop continues till all the files are complete
Hope this helps
cheers
Thanks Anil_G. Parallel for each worked!
Thanks everyone for the support ![]()
Glad it helped.
Can you please mark the solution and close so that other with similar issue can get the answer easily
Happy Automation
cheers