Data factory - ForEach Activity error - Next on empty iterator

Demarbre Sebastien 96 Reputation points
2021-06-29T14:29:42.93+00:00

Hello ,

I have created a pipeline with two nested foreach activities.
The first one is extracting a list of files to load.
The second loop is iterating through each file to join them together.

In other words, I have a object with two attribute : mainTable (which is a string) and dependencies (which is an array of string).
In the second foreach, I'm iterating through all the names in the dependencies array , loading the corresponding file and joining it with the mainTable file.

When my dependencies array contains only one object, it is working well.
However, it is not working when the array contains more than 1 item. I've done five test with different objects names in the dependencies array and each time, I have the error "Next on empty iterator".

Does anyone know how to fix that issue ?

Thank you

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,624 questions
{count} votes

Accepted answer
  1. Demarbre Sebastien 96 Reputation points
    2021-07-02T07:10:34.273+00:00

    Hello @ShaikMaheer-MSFT ,

    I've managed to fix the issue yesterday evening.
    Apparently it was linked to the source file encoding. I think some of the files were in Unicode, some were uin UTF-8. Now, everything is in UTF-8 and the pipeline ran successfully.

    Thus, not really linked to the iterator. I think I was just lucky with all my previous tests , I selected only files with right encoding.

    Thanks for your help.

    Sebastien


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.