ForEach Activity in ADF - can you skip an inner activity if one fails? QA Failure please help

Mike Kiser 1,531 Reputation points
2021-02-23T17:08:09.893+00:00

HellO!
@Nasreen Akter @MartinJaffer-MSFT

I have a ForEach with a Web Activity inside looking for a social security number from the employees DB. A couple of times, the Employee doesn't exist so the Web Activity fails inside the ForEach and stops my entire process. If it fails which is rare, I want to just keep on going. Is there a way to do this? Thanks!! Mike Kiser

Please see below....
71213-screenshot-2021-02-23-110609.jpg

Please see the following. When my Set Variable fails due to no social security number then the entire ForEach fails ....I need it just to skip the failure and keep processing. Thanks!
71177-screenshot-2021-02-23-112337.jpg

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,534 questions
0 comments No comments
{count} votes

Accepted answer
  1. HimanshuSinha-msft 19,376 Reputation points Microsoft Employee
    2021-02-23T19:29:18.17+00:00

    Hello @Mike Kiser ,

    I think what @Nasreen Akter suggested should work but may be you can try to see if setting up the "Completion" dependency does the trick in your case .

    71264-2021-02-23-11-25-29-analytics-moveandtransform-ver.png

    Please do let me know how it goes .
    Thanks
    Himanshu
    Please do consider to click on "Accept Answer" and "Up-vote" on the post that helps you, as it can be beneficial to other community members

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Nasreen Akter 10,736 Reputation points
    2021-02-23T18:09:22.677+00:00

    Hi @Mike Kiser ,

    You can have a IF Condition for checking the status just before set SSN activity e.g., something like:

    @contains(toUpper(activity('WEBActivity').output.runtimeStatus), 'COMPLETE')  
    

    If your WebActivity does not return runtimeStatus, check which field you can use from the return response e.g., StatusCode, or any other custom status and use that instead.

    Thanks!