For Each Loop doesn't loop through files but automatically ends loop after first round

Hi everyone,

I’m having problems with my For Each loop. I want the For Each loop to do a set of activities, i.e. upload a file to a plattform. Here’s my loop:

The For Each loop is supposed to loop through all files that are stored in the variable FilesToUpload of type System.String but unfortunately stops after the first iteration. The first iteration works properly though.

I’ve checked if the variable FilesToUpload really stores different files as the files are spread over different folders and my output confirms that in fact every file (3) is stored correctly.

Here’s how I retrieved and saved the files to the variable:

Anyone has an idea why the For each loop doesn’t work properly?

Cheers :slight_smile:

Like can I know below things

  1. Did u put may break activitiy after the iteration

  2. Did u face any error in Workflow?

No, I didn’t put any break nor did I get an error.

I just tried the whole process again but this time with all the files that are supposed to be uploaded in one folder and not in several. Then it works. Hence, I think the mistake must be in the accessing process of the files. Even though the message box display that there are 3 files saved in the variable. It would be great though if it works with several folders as well.