Can't read JSON data from key

ruimac

Member
When I try to access data from a json file that I loaded using the LoadFile command, using the command GetString, no matter what path I set, I always get the error:

ERROR: [json.exception.type_error.302] type must be string, but is null

When I dump the json file to a string, using Dump( ), the resulting string reflects the correct json file.
But I can't seem to specify the correct paths to get access to the data inside it.
Here is a sample of the begining of the json file:

{"dataPrev": "2023-08-28", "dataRun": "2023-08-27", "fileDate": "2023-08-28 00:05:01", "local": {"0101": {"data": {"rcm": 4}, "dico": "0101", "latitude": 40.58, "longitude": -8.44}, "0102": {"data": {"rcm": 4}, "dico": "0102", "latitude": 40.6909, "longitude": -8.4784}, "0103": {"data": {"rcm": 4}, "dico": "0103", "latitude": 40.44, "longitude": -8.44}, "0104": {"data": {"rcm": 4}, "dico": "0104", "latitude": 40.93, "longitude": -8.26}, "0105": {"data": {"rcm": 2}, "dico": "0105", "latitude": 40.6413, "longitude": -8.6535}, "0106": {"data": {"rcm": 4}, "dico": "0106", "latitude": 41.0409, "longitude": -8.2707}, "0107": {"data": {"rcm": 2}, "dico": "0107", "latitude": 41.01, "longitude": -8.64}, ...

The Size property returns 4, that corresponds to the "dataPrev", "dataRun", "fileDate" and "local" items.
But I need to go through all the items inside the "local" item and I can't seem to be able to do so, using the json commands inside Viz.
How can I go through all the items inside "local" or even get a reading of how many items are inside it? Can anyone help?
 
Back
Top