0

Hubspot JSON data alignment issue

Hi all,

I'm having issues with data alignment with the Hubspot's "Get the statistics of all marketing emails" api call.  The issue is that the root includes an object called "stats" if the email was published but not if it's in a draft state.  That object, stats, has a child object called "counters", which has individual attributes (ie sent, delivered, clicked, etc).  I'm after those attributes (sent, delivered, etc).

The JSON looks like this:

[{
  id:1234,
  name: "Published email",
  stats: {
      counters:{
        sent:12,
        delivered:11
      }
   }
},
{
  id:1235,
  name: "Draft email"
}
]

I've tried using kf:fill_elements but have not been successful.  I thought the following should work but it just errors within the modeling interface:  kf:fill_elements(/,'stats','counters','sent').  When I limit the fill_elements function to two nodes (doesn't matter which two) there are no errors but the data isn't correct.  Does fill_elements only allow 2 levels of fields to fill?  How would I accomplish filling this hierarchy in the JSON?

0 comments

Please sign in to leave a comment.