Hi All,
I'm using JMP 15 and have JSL that retrieves a JSON payload via Http Request(), runs it through Char to Blob(), and then open()s it in a data table. The JSON payload content is dynamic, but is always mappable to a tabular format (rows and columns).
The issue: if any keys in the JSON have all NULL values, they are not included in the data table (i.e., no columns are created for these keys). This is problematic, because I want all of the keys in the JSON to be displayed as columns in the data table, whether all values are NULL or not.
If I save the payload in a local file and open it directly using Open(), I get the desired result: a data table where all keys are converted to columns, and all NULL values are displayed as NULLs. However, this won't work for my use case.
Here is basic JSL that replicates the problem. Instead of Http Request(), I retrieve the data with Load Text File(), which gives the same results. The file "data.json" is attached.
dt1 = Open("/Users/abc/data.json", JSON ); // works as desired
raw = Load Text File("/Users/abc/data.json");
jsonblob = Char To Blob( raw );
dt2 = open(jsonblob, "JSON", Guess("wide")); // does not work as desired -- drops all-NULL columns
Can anyone suggest a method to convert JSON in a variable into a data table that preserves the all-NULL keys?
Thanks!
Andy