ADF - Copy complex nested Json to SQL

DataS 5 Reputation points
2023-03-13T15:58:31.8233333+00:00

Hello,

I got a question about ADF, processing an nested Json file. Just copied a snippet of it down here.
The thing is that i cant seem to make it work to get the nested values more than once.

For example, this is what the output in SQL db should be.
You can see the the EAN code 4065447985576, this has 2 locations underneath. I need to process this with the two

If i use the simple copy method it works, but only with the Eancode nodes that have 1 nested code underneath. With more than one node, it will be null:
User's image

And i need it to be like:

User's image

Hereby the snippet of the json source file.

I hope somebody can help me out or put me in the right direction of what dataflow functions i can use in order to make this work.

Thanks in advance!

{
  "PriceItems":
  {

    "PriceItem": [     {
      "EanCode": "93839303839303",
      "Locations":
      {
        "Location":
        {
          "Code": "53646775745747",
          "Price": "169.95",
          "ShopPrice": "169.95",
          "WebshopPrice": "169.95"
        }
      }
    },     {
      "EanCode": "463463469973646",
      "Locations":
      {
        "Location":
        {
          "Code": "54364364643636",
          "Price": "169.95",
          "ShopPrice": "169.95",
          "WebshopPrice": "169.95"
        }
      }
    },     {
      "EanCode": "4065447985576",
      "Locations":
      {

        "Location": [         {
          "Code": "5472457575452",
          "Price": "169.95",
          "ShopPrice": "169.95",
          "WebshopPrice": "169.95"
        },         {
          "Code": "849409484940729",
          "Price": "169.95",
          "ShopPrice": "169.95",
          "WebshopPrice": "169.95"
        } ]
      }
    },     {
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.