Terminating ForEach loop on error RRS feed

  • Question

  • Hi All, 

    I am using ADF V2, and I have a meta data activity which acts as a input to For each loop(Sequential), now we are performing delta load, so if there are 5 files, first 2 are processed successfully, but fails at 3rd, I want for each loop to error out and exit instead of trying to load file #4 and #5. Please let me know if you have handled this scenario or have any clue where I can start with.

    Thanks for reading this out. 

    Thanks, Amit

    Tuesday, October 1, 2019 12:17 PM

All replies

  • Hi Amit,

    All the activities inside ForEach activity are run in parallel. So it doesn't get affected by any parallel activity failure. Only that iteration fails wherein any activity fails.

    Even using sequential in the foreach activity won't help in this case, as it just makes the activities run sequentially. Even if an activity fails it just moves on to the other activity in the foreach.

    You may try by using an 'Until' activity in place of ForEach, setting a variable(flag) at the end of the activities. 



    Tuesday, October 1, 2019 3:49 PM
  • Hi Raj_Hillman, thank you so much for sharing your insights. Appreciate your engagement in helping the community.

    Hi AgrawalAmit, Just checking in to see if the above suggestion from Raj_Hillman was helpful. If this answers your query, please do click “Mark as Answer” and/or Up-Vote, as it might be beneficial to other community members reading this thread. And, if you have any further query do let us know.

    Thank you

    If a post helps to resolve your issue, please click the "Mark as Answer" of that post and/or click Answered "Vote as helpful" button of that post. By marking a post as Answered and/or Helpful, you help others find the answer faster.

    Wednesday, October 2, 2019 5:48 PM
  • Hi Raj, thanks for your response let me try this and get back to you! 
    Thursday, October 3, 2019 9:02 AM