New Database from JSON

It seems that New Database from JSON file only opens a new database with the field A.
Same result from Import New Database from JSON file.

Is this feature implemented?

Yes, this feature is definitely implemented. However, you must have a JSON file that contains an array of records. Each element in the array will become a record in the new database. A while ago I amazed the local programming club by automatically importing various JSON files they threw at me. But it’s certainly true that not all JSON files will work.

Where did you get your JSON file?

Hi Jim,

The format for the JSON file is as follows.

[
{
“source”: “”,
“threadId”: 1,
“link”: “link”,
“imageLinks”: [],
“references”: [
{
“source”: “”,
“threadId”: 2,
“link”: “”,
“imageLinks”: [],
“references”: [],
“no”: 147005381,
“uniqueId”: “0d41a344-7454-48fc-b0da-282b4da49421”,
"_unixEpoch": “1970-01-01T00:00:00Z”,
“text”: “>>Some Text”,
“postDate”: “2017-10-28T15:33:50”,
“time”: 1509219230,
“tn_h”: 0,
“tn_w”: 0,
“h”: 0,
“w”: 0,
“tim”: null,
“fsize”: 0,
“filename”: null,
“ext”: null,
“md5”: null,
“last_modified”: 0,
“sub”: null,
“com”: null,
“name”: “”,
“trip”: null,
“replies”: 0
}
],
“no”: 147012719,
“uniqueId”: “554fd19d-0803-4108-b54d-34f804586b47”,
"_unixEpoch": “1970-01-01T00:00:00Z”,
“text”: “>>147005381\More Text”,
“postDate”: “2017-10-28T16:44:28”,
“time”: 1509223468,
“tn_h”: 0,
“tn_w”: 0,
“h”: 0,
“w”: 0,
“tim”: null,
“fsize”: 0,
“filename”: null,
“ext”: null,
“md5”: null,
“last_modified”: 0,
“sub”: null,
“com”: null,
“name”: “sm”,
“trip”: null,
“replies”: 0
},
{
“source”: “”,
“threadId”: 146981635,
“link”: “”,
“imageLinks”: [],
“references”: [],
“no”: 147023341,
“uniqueId”: “9a0105fd-b145-43f5-9da6-c56052967913”,
"_unixEpoch": “1970-01-01T00:00:00Z”,
“text”: “”,
“postDate”: “2017-10-28T18:15:48”,
“time”: 1509228948,
“tn_h”: 0,
“tn_w”: 0,
“h”: 0,
“w”: 0,
“tim”: null,
“fsize”: 0,
“filename”: null,
“ext”: null,
“md5”: null,
“last_modified”: 0,
“sub”: null,
“com”: null,
“name”: “Anonymous”,
“trip”: null,
“replies”: 0
},
{
this repeats for all records
},
{
last record
}
]

Try a JSON validator https://jsonlint.com

I’ve used the below validator and it also allowed me a download of a JSON file which is linked below.
JSON Validator

I’ve put the JSON file here if someone could tell me why Panorama does not like it.

Zipped JSON file

The problem is that the root level of your JSON file doesn’t contain the array you want to import. The array is nested inside another object. I opened it in a program called Power JSON Editor to look at the structure.

You have to spoon feed Panorama the array you want to import. It’s as if you gave Panorama a CSV file to import but embedded the CSV data in a bunch of extra text. Panorama has no way of figuring out what you really meant for it to do.

Once the extra text is cut off the top and bottom Panorama imports this file just fine.

So as Sgt. Joe Friday would have said, “All we want are the data ma’am, just the data.”

The ugly part is that as JSON is not widely understood, and as the Validator that I referenced above said it was good JSON (per RFC 8259), perhaps there might be some way to telling the user (or handling it automatically) to do this stripping of the ‘header and footer’ kind of stuff. It seems that I had something akin to a 3 dimension array instead of an expected 2 dimension array, with my ‘items’ explainer.
I understand the issue, and for me to automate the import of this data will take some extra contortions but alas, isn’t that what we are all too often having to do.

Thank you for your eyeballs and brain cells.

I spent some time last night working on a replacement for zipinfoplus that uses zip-codes.com’s API. In this case, it was easier not to use the JSON tools in Panorama, but tagdata( to get the data into the same dictionary that zipinfoplus uses. There is one difference in that dictionary, and it should now have return an ERROR code, so I will know why it does not work.