Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
Highlighted

JSON import from URL: misaligned output table

Hi all,

I'm trying to import data from an URL which return json data. Example json data looks like this:

{"csvrow": ["237", "623", "1967"], "name": ["A_N10_C010_R196", "A_N10_C270_R092", "A_G12_C220_R189"], "optRs": ["0.0", "0.0", "0.0"]}


Following the approach discussed here How to parse a JSON file opened from URL? 


I'm using a simple script command:
open([URL], JSON)

Otherwise it works fine, but the output table is misaligned (cannot a attach a screenshot here but maybe this tells the strory):

  csvrow name optRs
1 237    
2 623    
3 1967    
4   A_N10_C010_R196  
5   A_N10_C270_R092  
6   A_G12_C220_R189  
7     0
8     0
9     0

 

 

Should I pass some parameters to the open command to get a table of only 3 rows, values in each cell? Like this:

  csvrow name optRs
1 237 A_N10_C010_R196 0
2 623 A_N10_C270_R092 0
3 1967 A_G12_C220_R189 0


The documentation looked somewhat thin on this. 

 

Thanks for help!




1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Craige_Hales
Staff (Retired)

Re: JSON import from URL: misaligned output table

JMP 15 has a JSON wizard that will do better.

JSON wizardJSON wizard

You can also use File->Open and pick the json filter and ask for the wizard

Pick the json filter and ask for the preview wizardPick the json filter and ask for the preview wizard

 

Grab the table's source script to repeat it later without the wizard.

Craige

View solution in original post

2 REPLIES 2
Highlighted
Craige_Hales
Staff (Retired)

Re: JSON import from URL: misaligned output table

JMP 15 has a JSON wizard that will do better.

JSON wizardJSON wizard

You can also use File->Open and pick the json filter and ask for the wizard

Pick the json filter and ask for the preview wizardPick the json filter and ask for the preview wizard

 

Grab the table's source script to repeat it later without the wizard.

Craige

View solution in original post

Highlighted

Re: JSON import from URL: misaligned output table

Thanks - this is exactly what I was looking for!