I am trying to check if the dataflow has written any rows to the sink and capture the activity output. the update statement fails, if the activity doesn't write any rows to the sink , so as per MS docs I am trying the below expression in a lookup activity.
***DECLARE @Date DATETIME;
SET @Date = GETDATE();
DECLARE @ROWSAFFECT INT;
SET @ROWSAFFECT = if(contains(@{activity('dataflow').output.runStatus}, 'sink'), '@{activity('dataflow').output.runStatus.metrics.sink.rowsWritten}','0');
update table [schema].[audit_table]
SET LOAD_STATUS ='Success'
,ROWS_AFFECTED = @ROWSAFFECT
select 1;***
But this fails with a parse error. Can someone please help me with this?
=A database operation failed with the following error: 'Parse error at line: 4, column: 217: Incorrect syntax near ']'.'


