How to store data from complex JSON in Azure DB using AZURE Synapse

Mayur Takle 1 Reputation point
2021-04-05T08:25:54.383+00:00

Hi,

We are having a JSON structure where in 2 JSON object are nested. Please find below JSON example for your reference.
We need a way to store this data in the database.

result is a json array object which we can flattened in dataflow in different columns. But our target is to store the data in the below objects "782005" in the tables. you can see that the content in the all the objects is same. we don't want to create separate files/tables for the same. We want to store then in one table.

[
{
"count": 52,
"results": [
{
"key": "custom_fields",
"id": "782005"
},
{
"key": "custom_fields",
"id": "782015"
},
{
"key": "custom_fields",
"id": "782045"
}

],
"custom_fields": {
  "782005": {
    "updated_at": "2021-02-24T11:43:19+00:00",
    "created_at": "2021-02-24T11:43:19+00:00",
    "name": "Client ID",
    "value_type": "string",
    "custom_field_set_id": "290485",
    "id": "782005"
  },
  "782015": {
    "updated_at": "2021-02-24T11:43:39+00:00",
    "created_at": "2021-02-24T11:43:39+00:00",
    "name": "ERP Status",
    "value_type": "single",
    "custom_field_set_id": "290485",
    "id": "782015"
  },
  "782045": {
    "updated_at": "2021-03-03T16:55:41+00:00",
    "created_at": "2021-02-24T11:47:00+00:00",
    "name": "Billing Office Name",
    "value_type": "single",
     "custom_field_set_id": "290485",
    "id": "782045"
  },

"meta": {
"count": 52,
"page_count": 3,
"page_number": 1,
"page_size": 20
}
}
]

Any suggestion.

Thanks
Mayur

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
5,004 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,873 questions
Azure Maps
Azure Maps
An Azure service that provides geospatial APIs to add maps, spatial analytics, and mobility solutions to apps.
737 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Kiran-MSFT 691 Reputation points Microsoft Employee
    2021-04-05T16:26:44.497+00:00

    You can use the map datatype recently added to dataflows. There are several functions where you can convert the array of structures to a map value


Your answer

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