To loop through the files using REframework

Hey,

I’m currently using a 2 for each loop
One - to go through two different folders,
the second one to fetch the files present in the 2 folder.

I want to implement the same in REF.
I’m confused as to what variable type should I use Transaction Item and for which loop should I assign Transaction Item.

Thanks in Advance!

The transaction item can remain a queue item as defined. Make sure your dispatcher is sending the path to each of the files. You can do this by iterating over System.IO.Directory.GetFiles(MyFolderPath1) and System.IO.Directory.GetFiles(MyFolderPath2), where MyFolderPath1 and MyFolderPath2 are strings containing the paths to each of your folders. Inside each of the loops, you’ll need to add a queue item with the reference set to the item in the For Each loop.

Hey @Anthony_Humphries,
Can I use string and make the whole process instead of using Dispatcher

You can by loading the strings into the TransactionData table in a single column in the Init state. This will be a matter of using Add Row activities in the Init state on the first run only instead of using Add Queue Item.

1 Like

@ray_sha Change Transaction Item variable as string type and it contains folder name and inside process workflow make a logic to loop through folder i.e. Transaction Item

2 Likes