Flatten Properties

Flatten Properties

Flattens nested event properties into top-level keys joined by a separator, for example a.b.c becomes a__b__c.

Configuration

OptionDescription
Separator
Type: string
Required: True

The string used to join nested keys, for example __ turns a.b into a__b.

Using our REST API you can create this transformation like so:

Terminal
# Create a new destination
curl --location 'https://us.i.posthog.com/api/environments/:project_id/hog_functions' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <POSTHOG_PERSONAL_API_KEY>' \
--data '{
"type": "transformation",
"name": "Flatten Properties",
"inputs": {
"separator": {
"value": ""
}
},
"enabled": true,
"template_id": "template-flatten-properties"
}'