redwolf_cr7
redwolf_cr7

Reputation: 2037

How to Get Row Count of the Result from Exists Activity in Azure Data Factory Data Flow?

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

Answers (1)

Rakesh Govindula
Rakesh Govindula

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.

enter image description here

To get this count in the ADF pipeline, use the below expression after dataflow activity.

@activity('Data flow1').output.runStatus.metrics.<sink name>.rowsWritten

enter image description here

Result:

enter image description here

Upvotes: 2

Related Questions