JSON to array

Hi guys,
I have a JSON response that I need to convert in arrays. The response looks like:

[{“id”:12345,“title”:“Second Test”,“tags”:false},{“id”:12344,“title”:“Dummy Test”,“tags”:false}]

I know how to get the single property out of a single JSON record, but if the response has more items (like the one shown), getProperty doesn’t return nothing.

Any advice?

Something like this. Just typing it here, completely untested:

var json = JSON::parse(jsonString);
if (json.isArray())
  for (auto v : *json.getArray())
    String id = v.getProperty("id");
    String title = v.getProperty("title");
    bool tags = v.getProperty("tags");
1 Like

Thanks! That’s what I were looking for.