Reputation: 2037
I am currently working on a data flow in Azure Data Factory where I need to check if the contents of a CSV file match with the contents of an SQL table. For this purpose, I am using the Exists activity.
While I am able to see the results of the Exists activity in the Data Preview section, I am struggling to find a way to get the total number of rows in the result set.
Here is what I have done so far:
However, I need to get the count of these rows programmatically so I can use it in further activities within the pipeline.
My questions are:
Any guidance or examples would be greatly appreciated!
Additional Details:
Thank you!
Upvotes: 0
Views: 1008
Reputation: 11234
If you are using exists transformation before your SQL sink in the dataflow, you can get the record count like below.
The dataflow activity output JSON will contain the rowsWritten
count to the sink.
To get this count in the ADF pipeline, use the below expression after dataflow activity.
@activity('Data flow1').output.runStatus.metrics.<sink name>.rowsWritten
Result:
Upvotes: 2