---
schema_version: "1"
id: ca887ad886d466dc35d27d9af121a36f6c18e80a0a0b87ffef358000e74e1406
title: Flatten JSON Data
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/data/264-0-0/c360_a_batch_transform_flatten_json.md
canonical_url: https://help.salesforce.com/s/articleView?id=data.c360_a_batch_transform_flatten_json.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 3cfe51bf5fbf1d5625447416b2dea768fb93bf557acd565f8d7f3928eb712eb6
description: Turn data ingested as a JSON string into tabular data in a batch transform. To use data in downstream features, such as identity resolution and segmentation, the data must be stored as rows and columns in a data lake object or data model object. You can flatten JSON data that’s stored as a single object, an array of objects, or an array of literals (scalar values).
products:
  - Data 360
release: "264"
---
# Flatten JSON Data

Turn data ingested as a JSON string into tabular data in a batch transform. To use data in downstream features, such as identity resolution and segmentation, the data must be stored as rows and columns in a data lake object or data model object. You can flatten JSON data that’s stored as a single object, an array of objects, or an array of literals (scalar values).

A schema file describing the structure and content of the JSON data is required to flatten nested JSON. This file can be created manually or generated from a sample of your JSON data using a web utility.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-data-data_cloud-264-0-0-production-enus/f3569962-3c9b-4f83-9d0c-b6a574e785da/images/icon_note.png)

Note :

Only the 'type', 'properties', and 'items' keywords are recognized from the schema file; all others are ignored.

The row will not be processed and included in the results if the JSON data is malformed.

The maximum JSON level limit is 6. The 'properties' keyword has a maximum limit of 50.

1. In a transform node, select the input field containing the JSON data you want to flatten, and then select the Flatten JSON transformation.
2. Select **Upload File**, and select your JSON schema file.
3. Enter a transformation name.
4. Add at least one output table.
    1. Select **Add New Table**.
    2. Enter a name for the table.
    3. Select one or more fields to extract from the JSON data.
5. To save the configuration, click **Apply**.
6. To preview table data, add a node to the output branch for that table.

![Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-data-data_cloud-264-0-0-production-enus/f3569962-3c9b-4f83-9d0c-b6a574e785da/images/icon_example.png)

Example Your data table includes the fields `order_id` and `json_data`. `Order_id` contains an integer that identifies the order. `Json_data` contains JSON data strings with important information about each order. You want to extract data about orders into tables so that you can calculate insights, such as customer lifetime value.

 
| order\_id | json\_data |
| --- | --- |
| 1 | {"customer": "John", "items": \[{"id": 101, "name": "Laptop", "price": 1500}, {"id": 102, "name": "Mouse", "price": 20}\]} |
| 2 | {"customer": "Alice", "items": \[{"id": 103, "name": "Keyboard", "price": 50}, {"id": 104, "name": "Monitor", "price": 300}\]} |

To ensure that Data 360 can properly interpret your JSON data, upload a schema file that conforms to the JSON schema specifications. This sample schema file describes the data in the data table.

```
{
  "type": "object",
  "properties": {
    "customer": {
      "type": "string"
    },
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "price": {
            "type": "number"
          }
        },
        "required": ["id", "name", "price"]
      }
    }
  },
  "required": ["customer", "items"]
}
```