IMPORTJSONAPI icon indicating copy to clipboard operation
IMPORTJSONAPI copied to clipboard

How to parse the full response

Open arturaslaz opened this issue 5 years ago • 2 comments

First of all - beautiful function, just what I was looking for. I've got more of a question I guess than an issue. So I've got a JSON response like so:

{
  "metrics": [
    {
      "human_date": "2016-11-26",
      "active_customers": 642,
      "active_subscriptions": 642
    },
    {
      "human_date": "2016-11-27",
      "active_customers": 640,
      "active_subscriptions": 640
    }
  ]
}

And I'm querying it like so to get the metrics $.metrics.* and passing human_date, active_customers and active_subscription as column parameters, and I get back the data perfectly. But how do I get all the data from the metrics array and formatted with headers without actually knowing what kind of metrics will I get back from the API in advance?

I can manage getting the metrics themselves in a list like so $.metrics...~ but I cannot get them back as column names/headers.

Any ideas?

arturaslaz avatar Mar 30 '20 11:03 arturaslaz

Thanks for the feedback! As to your question you can't do this at the moment but it is something that could be added. I'll need a few days to think about the best way to implement this feature.

qeet avatar Mar 30 '20 14:03 qeet

I am looking to get column headers for my json data also

JonathonRP avatar Nov 24 '22 04:11 JonathonRP