title: Azure Data Factory Copy Activity on Failure | Expression not evaluated
body: <p>I'm trying to run a copy activity in ADF and purposely trying to fail this activity to test my failure logging. </p>
  
  <p>Here is what the pipeline looks like (please note that this copy activity sits inside a "for each" activity and (inside "for each") an "if conditional" activity.</p>
  
  <p><a href="https://i.stack.imgur.com/cafkw.jpg" rel="nofollow noreferrer">This is how the pipeline looks</a></p>
  
  <p>I'm expecting the copy to fail, however not for the "LOG FAILURE" stored procedure, since I want to log the copy activity details in a SQL DB table. Here is what the error says:</p>
  
  <p>In the LOG FAILURE activity:</p>
  
  <p>"errorCode": "InvalidTemplate",
  "message": "The expression 'activity('INC_COPY_TO_ADL').output.rowsCopied' cannot be evaluated because property 'rowsCopied' doesn't exist, available properties are 'dataWritten, filesWritten, sourcePeakConnections, sinkPeakConnections, copyDuration, errors, effectiveIntegrationRuntime, usedDataIntegrationUnits, billingReference, usedParallelCopies, executionDetails, dataConsistencyVerification, durationInQueue'.",
  "failureType": "UserError",
  "target": "LOG_FAILURE"</p>
  
  <p>In the Copy activity INC_COPY_TO_ADL (this is expected since the SQL query is wrong)</p>
  
  <p>"errorCode": "2200",
  "message": "Failure happened on 'Source' side. ErrorCode=SqlOperationFailed,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=A database operation failed with the following error: 'Invalid object name 'dbo.CustCustomerV3Staging123'.',Source=,''Type=System.Data.SqlClient.SqlException,Message=Invalid object name 'dbo.CustCustomerV3Staging123'.,Source=.Net SqlClient Data Provider,SqlErrorNumber=208,Class=16,ErrorCode=-2146232060,State=1,Errors=[{Class=16,Number=208,State=1,Message=Invalid object name 'dbo.CustCustomerV3Staging123'.,},],'",
  "failureType": "UserError",
  "target": "INC_COPY_TO_ADL"</p>
  
  <p>I wonder why the LOG Failure activity failed (i.e. the expression was not evaluated)? Please note that when the copy activity is correct, the "LOG SUCCESS" stored procedures works okay.</p>
  
  <p><a href="https://i.stack.imgur.com/kt4nN.jpg" rel="nofollow noreferrer">This is how the pipeline looks like</a></p>
  
  <p>Many thanks.
  RA</p>