early-table-25049
11/21/2023, 6:39 AMmillions-activity-52391
11/21/2023, 6:39 AMshy-kite-21035
11/21/2023, 12:32 PM{
“anonymousId”: “8d872292709c6fbe”,
“context”: {...},
“event”: “Product Clicked”,
“messageId”: “1590431830915-73bed370-5889-436d-9a9e-0c0e0c809d06”,
“properties”: {
“currency”: “USD”,
“testArr”: [1,2,3],
“testmap”: {“nestedMap”: {“a”: 1, “b”: 2}},
“price”: “58.0”
},
“originalTimestamp”: “2020-05-25T183710.917Z”,
“type”: “track”,
“userId”: “sample_user_id”
}Then you can mention
testArr, testap.nestedMap and the array will not be flattened and the map will not be flattened beyond the nestedMap level.shy-kite-21035
11/21/2023, 12:37 PMexport function transformEvent(event, metadata) {
if (event.type !== "track") {
return event;
}
const property = event.event; // Edit event name
event.properties.event = property;
event.event = "Track Event"
return event;
}
Changed payload
> {
> “anonymousId”: “8d872292709c6fbe”,
> “context”: {...},
> “event”: “Track Event”,
> “messageId”: “1590431830915-73bed370-5889-436d-9a9e-0c0e0c809d06",
> “properties”: {
> “currency”: “USD”,
> “event”: “Product Clicked”
> “testArr”: [1,2,3],
> “testmap”: {“nestedMap”: {“a”: 1, “b”: 2}},
> “price”: “58.0"
> },
> “originalTimestamp”: “2020-05-25T183710.917Z”,
> “type”: “track”,
> “userId”: “sample_user_id”
> }millions-activity-52391
11/21/2023, 12:39 PMearly-table-25049
11/21/2023, 12:44 PMtrack.properties via transformations and destination configuration both and couldn't make it work. Is there any issue with this jsonPath?shy-kite-21035
11/21/2023, 1:03 PMexport function transformEvent(event, metadata) {
const allProperties = {...event.properties};
const newProperties = {allProperties};
event.properties = newProperties;
return event;
}
You can then use the allProperties object as your JSON object.
This should ideally work but you should test it out before deploying.early-table-25049
11/23/2023, 8:29 AMmillions-activity-52391
11/23/2023, 2:14 PMearly-table-25049
11/27/2023, 7:24 AMevent.allProperties = newProperties;
Let me try this out and get back with any Qs! Thanksearly-table-25049
12/06/2023, 8:31 AMevent.event to Track Event ensures that we have only a single table called Track Event on Snowflake âś…
However in the Track Event table I'm seeing that while there is a json column for properties (with a different name), the original properties column is still being flattened. Because Track Event has all the events flowing into it, I can see thousands of columns being created as a result of properties being flattened. Can I prevent this?
Or if I can stop Track Event from being created on Snowflake, that also works because I have all the info I need in the Tracks table, now that the new properties column is already being synced there.millions-activity-52391
12/06/2023, 5:49 PMmillions-activity-52391
12/07/2023, 9:24 AM