5
votes

I am designing a ADF pipeline that copies rows from a SQL table to a folder in Azure Data Lake. After that the rows in SQL should be deleted. But for this delete action takes place I want to know if the number rows that are copied are the same as the number of rows that were I selected in the beginning of the pipeline. Is there a way to get the rowcount fo the copy action and use this in another action (like a lookup)

Edit follow up question: Bo Xiao's answer is OK. BUt then I have a follow up question. After the copy-activity I put an If Condition with the following expression:

@activity('LookUpActivity').output.firstRow.RecordsRead ==      @{activity('copyActivity').output.rowsCopied

But then I get the error: @activity('LookUpActivity').output.firstRow.RecordsRead == @{activity('copyActivity').output.rowsCopied

Isn't it possible to compare output parameters of two activities to see if this is True?

extra edit: I just found an error in this piece of code. I forgot a "{" at the begin of the code. But then the code is still wrong. To compare two outputs from earlier activities the code must be:

@equals(activity('LookUpActivity').output.firstRow.RecordsRead,activity('copyActivity').output.rowsCopied)
1

1 Answers

9
votes

You can find copied rows in activity output

And you can use the output value like this:

@activity('copyActivity').output.rowsCopied