Number of Rows Copied not fetching in email Azure Data Factory using rowsCopied property

Abhijit Ghosh 61 Reputation points
2022-06-16T17:24:09.72+00:00

I am trying to invoke number of rows copied during an Azure Data Factory Copy via Mail.I am using an Azure Logic App to achieve this. While trying to use the property rowsCopied its not fetching number of Rows copied. Below is my settings

JSON Sample Payload
{
"type": "object",
"properties": {
"title": {
"type": "string"
},
"message": {
"type": "string"
},
"color": {
"type": "string"
},
"dataFactoryName": {
"type": "string"
},
"pipelineName": {
"type": "string"
},
"pipelineRunId": {
"type": "string"
},
"time": {
"type": "string"
},
"number_of_rows_read": {
"type": "string"
}
}
}

Logic App template

<hr/>
<h2 style='color:@{triggerBody()?['color']}'>@{triggerBody()?['title']}</h2>
<hr/>
Data Factory Name: <b>@{triggerBody()?['dataFactoryName']}</b><br/>
Pipeline Name: <b>@{triggerBody()?['pipelineName']}</b><br/>
Pipeline Run Id: <b>@{triggerBody()?['pipelineRunId']}</b><br/>
Time: <b>@{triggerBody()?['time']}</b><br/>
number_of_rows_read: <b>@{triggerBody()?['number_of_rows_read']}</b><br/>
<hr/>
Information<br/>
<p style='color:@{triggerBody()?['color']}'>@{triggerBody()?['message']}</p>
<hr/>
<p style='color:gray;'>This email was generated automatically. Please do not respond to it. </p>

Web Activity

{
"title": " Ingestion SUCCEEDED!",
"message": "Pipeline run finished successfully!",
"color": "Green",
"dataFactoryName": "@{pipeline().DataFactory}",
"pipelineName": "@{pipeline().Pipeline}",
"pipelineRunId": "@{pipeline().RunId}",
"time": "@{utcnow()}",
"number_of_rows_read:":"@{activity('Copy_data_Activity').output.rowsCopied}"
}

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
6,306 questions
{count} votes

Accepted answer
  1. AnnuKumari-MSFT 19,116 Reputation points Microsoft Employee
    2022-06-17T11:19:12.397+00:00

    Hi @Abhijit Ghosh ,

    Welcome to Microsoft Q&A platform and thanks for posting your query.

    As I understand your requirement, you are trying to send out an email after the copy activity execution , for that you are using Logic apps. However , it's only sending out the partial data . Please let me know if my understanding is incorrect.

    You have provided number_of_rows_read: in the body of the webActivity. Kindly change it to number_of_rows_read as logic app is unable to find value for @{triggerBody()?['number_of_rows_read']} as 'number_of_rows_read' property won't be available .

    I tried to reproduce your scenario and am sharing my findings here:

    212457-image.png

    When I provided the body as the following: ![212511-image.png]2

    RowsCopied details came as empty : 212467-image.png

    Here , if you observe there is an extra colon, which is a typo that is the cause of the issue.

    When I change it to following: 212410-image.png

    I got the mail with proper data : 212417-image.png

    Hope this will help. Please let us know if any further queries.


    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you.
      Original posters help the community find answers faster by identifying the correct answer. Here is how
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification
    • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators

0 additional answers

Sort by: Most helpful