Hi @Anonymous
Welcome to Microsoft Q&A platform and thanks for posting your question.
It's possible to include the results of a copy activity in Azure Data Factory in an array. I've conducted a test to store the output of two copy activities in an array. We'll need to concatenate a string type and then convert it to a JSON type.
- We can define a variable of the array type called
CopyInfo
to store the output. Another variable, JsonArray
, is used to view the test result in debug mode.
- In the Append Variable1 activity, I utilize
@json(concat('{"activityName":"Copy1","activityObject":', activity('Copy data1').output, '}'))
to store the output of theCopy data1
activity and convert it from a String type to a Json type.
- In the Append Variable2 activity, I utilize
@json(concat('{"activityName":"Copy2","activityObject":',activity('Copy data2').output,'}'))
to store the output of theCopy data2
activity and transform it from a String type to a Json type.
- After that, I set the value of the variable
CopyInfo
to the variableJsonArray
.
- In the end, we can see the json array like:
"name": "JsonArray",
"value": [
{
"activityName": "Copy1",
"activityObject": {
"dataRead": 643,
"dataWritten": 643,
"filesRead": 1,
"filesWritten": 1,
...
},
{
"activityName": "Copy2",
"activityObject": {
"dataRead": 643,
"dataWritten": 643,
"filesRead": 1,
"filesWritten": 1,
...
}
}
]
Hope this helps. Do let us know if you any further queries.
If this answers your query, do click Accept Answer
and Yes
for was this answer helpful. And, if you have any further query do let us know.