Skip to content

Flatten json object

Description

The Flatten Json Object activity transforms JSON strings stored in column(s) into individual fields. It parses and expands nested properties from the selected columns, appending the new keys as new columns to the dataset.

Use Case
Often used when JSON data is stored in a single column (e.g., API responses, logs). This activity extracts nested keys into flat columns for easier filtering, analysis, or mapping in downstream steps.


Input

TypeDescription
DataDataset with one or more JSON columns.

Output

TypeDescription
Transformed DataOriginal dataset with JSON fields expanded into columns.

Configuration Fields

Field NameRequiredDescription
ColumnsYesList of column(s) containing JSON objects to be flattened.

Sample Input

employee_idnameagecontact
E001John Doe32{“email”:“[email protected]”, “phone”:“+1-555-1234”}
E002Jane Smith28{“email”:“[email protected]”, “phone”:“+1-555-5678”}
E003Ali Khan40{“email”:“[email protected]”, “phone”:“+1-555-9876”}
E004Maria Gonzalez35{“email”:“[email protected]”, “phone”:“+1-555-2468”}
E005Rahul Sharma30{“email”:“[email protected]”, “phone”:“+1-555-7890”}

Sample Configuration

FieldValue
Columnscontact

Sample Output

employee_idnameagecontactcontact_emailcontact_phone
E001John Doe32{“email”:“[email protected]”, “phone”:“+1-555-1234”}[email protected]+1-555-1234
E002Jane Smith28{“email”:“[email protected]”, “phone”:“+1-555-5678”}[email protected]+1-555-5678
E003Ali Khan40{“email”:“[email protected]”, “phone”:“+1-555-9876”}[email protected]+1-555-9876
E004Maria Gonzalez35{“email”:“[email protected]”, “phone”:“+1-555-2468”}[email protected]+1-555-2468
E005Rahul Sharma30{“email”:“[email protected]”, “phone”:“+1-555-7890”}[email protected]+1-555-7890

The new columns will be named based on the original column name and the JSON key (e.g., contact_email, contact_phone).