Reputation: 21
I want to remove the top-level field name and only preserve the values and save it as a file using Azure Data Factory. The JSON is consists of array of objects.
Current JSON
"response" : [
{},
{},
{}
]
Requirement
[
{},
{},
{}
]
Upvotes: 0
Views: 38
Reputation: 11489
You need to change the copy activity mapping as per your requirement.
First, I took the below data as my starting JSON input file.
{
"response":
[
{
"name":"PipelineName",
"type":"string"
},
{
"name":"Status",
"type":"string"
},
{
"name":"TimeGenerated",
"type":"datetime"
},
{
"name":"_ResourceId",
"type":"string"
},
{
"name":"Type",
"type":"string"
}
]
}
After adding both source and sink JSON datasets in the copy activity, go to mapping and enable the Advanced editor by giving your JSON array key name as shown below.
Now, to make the result as JSON array, select the file pattern in the sink as Array of objects.
Execute the copy activity and the result JSON file will be generated in the required format.
Upvotes: 0