Join our Community in its new Home - The Datorama Trailblazer Community Group!
It's been an amazing 3 years coming together in this forum to collaborate, innovate, support, and inspire each other about our shared usage of Datorama. While this is not quite a goodbye, we are excited to announce that we are getting a fresh start in our new home within the Salesforce Trailblazer Community. We have a ton of fun new content planned and you may even see the revival of some of our most popular posts from the past few years.
We’ll be keeping this group around for a bit for you to peruse, but as of November 15, we will no longer be allowing new posts or comments. Be sure to join our new group at https://www.salesforce.com/success-datorama to keep the conversation going.
We can’t wait to see you there!
It's been an amazing 3 years coming together in this forum to collaborate, innovate, support, and inspire each other about our shared usage of Datorama. While this is not quite a goodbye, we are excited to announce that we are getting a fresh start in our new home within the Salesforce Trailblazer Community. We have a ton of fun new content planned and you may even see the revival of some of our most popular posts from the past few years.
We’ll be keeping this group around for a bit for you to peruse, but as of November 15, we will no longer be allowing new posts or comments. Be sure to join our new group at https://www.salesforce.com/success-datorama to keep the conversation going.
We can’t wait to see you there!
Problems With JSON Layout


in Help Center
I've just started working with the Klaviyo API to get some basic email metrics in however, this is my first time using a custom API. I've set the data stream up correctly and I've successfully pulled in the JSON file, using the JSON Path part of the file transformer for "results[0].data", but I'm having problems with the structure of the JSON and mapping.
The data is very basic for now, it's just date and count of email opens as a test, with an example below.
The mapping is recognising the date field but doesn't show the values field at all. I have played around with the other JSON file transformer options and have discovered if I change the path to results[0].data[1] it returns date and "header" but "2020-09-24 00:00:00" and 5.0 are on separate rows.
Any help would be greatly appreciated.
The data is very basic for now, it's just date and count of email opens as a test, with an example below.
"results": [
{
"data": [
{
"date": "2020-09-23 00:00:00",
"values": [
0.0
]
},
{
"date": "2020-09-24 00:00:00",
"values": [
5.0
]
},
{
"date": "2020-09-25 00:00:00",
"values": [
5.0
]
}
The mapping is recognising the date field but doesn't show the values field at all. I have played around with the other JSON file transformer options and have discovered if I change the path to results[0].data[1] it returns date and "header" but "2020-09-24 00:00:00" and 5.0 are on separate rows.
Any help would be greatly appreciated.
Tagged:
Answers
Two suggestions:
- Use the 'flatten nested objects' checkbox in the JSON file transformer options
- The VALUE_FROM_JSON() function might be helpful
Thanks,Josh
Unfortunately the 'flatten nested objects' option only gives the dates, it doesn't seem to work with arrays. The other solution I believe would be useful if I can get the mapping to recognise that a value field even exists but currently it's either just date or a bunch of properties on the same level as "data".
Thanks,
Mat
Sorry I took a while to get back to you on this.
Unfortunately, I think this is impossible using the JSON file transformer. If you're retrieving the JSON data using HTTP retrieval, you could alternatively use Python retrieval in which you retrieve the JSON and transform it according to your needs.
I've done similar things, happy to send a simple template for the script.
Thanks,
Josh