title: Azure Data Factory V2 Copy Activity with Rest API giving one row for nested JSON
body: <p>I am trying to flatten a nested JSON returned from a Rest source. The pipeline code is as follows.
  The problem here is this pipeline returns only first object from JSON dataset and skips all the rest of the rows.
  Can you please guide me on how to iterate over nested objects.</p>
  
  <p>Thanks
  Sameet</p>
  
  <pre><code>{
      "name": "STG_NCR2",
      "properties": {
          "activities": [
              {
                  "name": "Copy data1",
                  "type": "Copy",
                  "dependsOn": [],
                  "policy": {
                      "timeout": "7.00:00:00",
                      "retry": 0,
                      "retryIntervalInSeconds": 30,
                      "secureOutput": false,
                      "secureInput": false
                  },
                  "userProperties": [],
                  "typeProperties": {
                      "source": {
                          "type": "RestSource",
                          "httpRequestTimeout": "00:01:40",
                          "requestInterval": "00.00:00:00.010",
                          "requestMethod": "GET",
                          "additionalHeaders": {
                              "OData-MaxVersion": "4.0",
                              "OData-Version": "4.0",
                              "Prefer": "odata.include-annotations=*"
                          }
                      },
                      "sink": {
                          "type": "AzureSqlSink"
                      },
                      "enableStaging": false,
                      "translator": {
                          "type": "TabularTranslator",
                          "mappings": [
                              {
                                  "source": {
                                      "path": "$['value'][0]['tco_ncrid']"
                                  },
                                  "sink": {
                                      "name": "NCRID"
                                  }
                              },
                              {
                                  "source": {
                                      "path": "['tco_name']"
                                  },
                                  "sink": {
                                      "name": "EquipmentSerialNumber"
                                  }
                              }
                          ],
                          "collectionReference": "$['value'][0]['tco_ncr_tco_equipment']"
                      }
                  },
                  "inputs": [
                      {
                          "referenceName": "Rest_PowerApps_NCR",
                          "type": "DatasetReference"
                      }
                  ],
                  "outputs": [
                      {
                          "referenceName": "Prestaging_PowerApps_NCREquipments",
                          "type": "DatasetReference"
                      }
                  ]
              }
          ],
          "annotations": []
      }
  }
  </code></pre>
  
  <p>The JSON is in the following format</p>
  
  <pre><code>[ 
     { 
        "value":[ 
           { 
              "tco_ncrid":"abc-123",
              "tco_ncr_tco_equipment":[ 
                 { 
                    "tco_name":"abc"
                 }
              ]
           },
           { 
              "tco_ncrid":"abc-456",
              "tco_ncr_tco_equipment":[ 
                 { 
                    "tco_name":"xyz"
                 },
                 { 
                    "tco_name":"yzx"
                 }
              }
           ]
        ]
     }
  ]
  </code></pre>