0

I am creating a pipeline for the first time. The requirement is to fetch a JSON file with an array of objects. Split the array and save each object as a separate item in the cosmos DB.

In pipeline I am using CopyData Activity. And providing the source as JSON File and using cosmos db dataset in Sink.

I am stuck with mapping the data. Since I have given the [0] array. All the values in db gets saved with same value. I am not sure how to map the value dynamically. Can someone assist if I there is a way to map dynamically based on the number of objects in the array. Or if I can use any other Activities.

Below is the JSON Data format.

{
"d": {
    "results": [
        {
            "OrderDescription": "abc",
            "SalesManager": "abc",
            "ProjectCoordinator": "",
            "CustomerNumber": "",
            "CustomerName": "",
            "CustomerStreetAddress": "",
            "CustomerCity": "",
            "CustomerState": "",
            "CustomerZiip": "",
            "FacilityName": "",
            "ShipToNumber": "",
            "ShipToName": ""
        },
        {
            "OrderDescription": "abc",
            "SalesManager": "abc",
            "ProjectCoordinator": "",
            "CustomerNumber": "",
            "CustomerName": "",
            "CustomerStreetAddress": "",
            "CustomerCity": "",
            "CustomerState": "",
            "CustomerZiip": "",
            "FacilityName": "",
            "ShipToNumber": "",
            "ShipToName": ""
        },
        {
            "OrderDescription": "abc",
            "SalesManager": "abc",
            "ProjectCoordinator": "",
            "CustomerNumber": "",
            "CustomerName": "",
            "CustomerStreetAddress": "",
            "CustomerCity": "",
            "CustomerState": "",
            "CustomerZiip": "",
            "FacilityName": "",
            "ShipToNumber": "",
            "ShipToName": ""
        }
    ]
}

}

Mapping

Sahaduna
  • 33
  • 4

1 Answers1

0

I found solution for the above question. Hope it helps someone.

Made few changes in the way of mapping.

Solution

Sahaduna
  • 33
  • 4
  • 1
    Hey Sahaduna, in the future please try to refrain from picture-only answers! Stack Overflow prides itself on being accessible and pictures are difficult for impaired individuals to parse :) – Aaron Meese Jul 09 '22 at 01:20