I was kind of hoping ASJSONExpr() would work on data tables, sadly no.
Does anyone have a function for taking a data table and putting it into a good JSON structure and vice versa?
Here are some of the things we have to account for
- column properties
- table variables
- table scripts
- modeling type
- data type
- row states
For context I'm trying to throw a schemaless jmp table to a database and have it be queriable
*Edit* I realized I should probably put in a wish list item for it. https://community.jmp.com/t5/JMP-Wish-List/JSON-of-a-JMP-table/idi-p/332510#M1300
*Edit 2* saw another post where you can save the data table as a json but it's only the rows
Names default to here( 1 );
dt = open("$SAMPLE_DATA\Big Class.jmp");
// exclude some rows
dt << Select Rows(1::14);
dt << Exclude();
temp_path = convert file path("$TEMP/table.json");
dt << Save AS(temp_path);
json = load text file(temp_path);
delete file(temp_path);
JSONtoDataTable(json);