question

ewinkiser avatar image
0 Votes"
ewinkiser asked ewinkiser commented

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

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
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

HimanshuSinha-MSFT avatar image
0 Votes"
HimanshuSinha-MSFT answered

Hello @ewinkiser ,

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


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

nasreen-akter avatar image
0 Votes"
nasreen-akter answered ewinkiser commented

Hi @ewinkiser,

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!

· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Awesome @nasreen-akter ! great idea....I have never been able to figure out how I can check a Web Activity's Status or Return code so that I can use your suggestion.

Any ideas on that?
Thanks again!!!!!!
MIke Kiser

0 Votes 0 ·

Hi @nasreen-akter

This is my return response:

This is the return response:
{
"Response": "",
"ADFWebActivityResponseHeaders": {
"Request-Context": "appId=cid-v1:3ce0b6fc-4711-4c53-a6ca-7e9fdfb79709",
"X-Employee-Count": "0",
"Date": "Tue, 23 Feb 2021 18:03:47 GMT"
},
"effectiveIntegrationRuntime": "mwt-azgate01-integrationRuntime01",
"executionDuration": 26,
"durationInQueue": {
"integrationRuntimeQueue": 2
},
"billingReference": {
"activityType": "ExternalActivity",
"billableDuration": [
{
"meterType": "SelfhostedIR",
"duration": 0.016666666666666666,
"unit": "Hours"
}
]
}
}
Thanks! Mike

0 Votes 0 ·

Hi @ewinkiser, I think you can check X-Employee-Count if its greater than 0 or not.

1 Vote 1 ·

Thanks @nasreen-akter ! I didn't know I can check that....it is a good practice I assume to have that in the pipelines...

Appreciate it again!
Mike Kiser

0 Votes 0 ·