<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to parse a list of JSON objects to separate columns? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-parse-a-list-of-JSON-objects-to-separate-columns/m-p/571629#M78132</link>
    <description>&lt;P&gt;Writing separate formulas for each of the results is one option&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1669037859451.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/47512i73B0CFD5C59A3130/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1669037859451.png" alt="jthi_0-1669037859451.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Parse JSON(:Column 1[1])["res1"];&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This can also be scripted to be more automatic&lt;/P&gt;</description>
    <pubDate>Mon, 21 Nov 2022 13:38:26 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2022-11-21T13:38:26Z</dc:date>
    <item>
      <title>How to parse a list of JSON objects to separate columns?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-parse-a-list-of-JSON-objects-to-separate-columns/m-p/480234#M72471</link>
      <description>&lt;P&gt;I'm trying to import the following data to JMP but all external data objects ends up in the same column. Is there a way to get it in separate columns? I get it to work with numerical values but not with strings. All strings ends up in the same columns with comma separated values. Thankful for your help.&lt;/P&gt;
&lt;PRE&gt;[{
"id": 1234,
"date": "2022-04-06",
"batch": {
"id": 1553,
"date": "2022-02-01"
},
"externalData": [
{
"orderNumber": 1,
"batchNumber": "bo09",
"partNumber": 121
},
{
"orderNumber": 1,
"batchNumber": "hoi112",
"partNumber": 129
},
{
"orderNumber": 1,
"batchNumber": "1ka10",
"partNumber": 432
} ,
{
"orderNumber": 1,
"batchNumber": "11la0",
"partNumber": 432
}
]
},{
"id": 1234,
"date": "2022-04-06",
"batch": {
"id": "1553",
"date": "2022-02-01"
},
"externalData": [
{
"orderNumber": 1,
"batchNumber": "14",
"partNumber": 121
},
{
"orderNumber": 1,
"batchNumber": "112",
"partNumber": 129
},
{
"orderNumber": 1,
"batchNumber": "110",
"partNumber": 432
}
]
}]&lt;/PRE&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:47:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-parse-a-list-of-JSON-objects-to-separate-columns/m-p/480234#M72471</guid>
      <dc:creator>Lovisa</dc:creator>
      <dc:date>2023-06-10T23:47:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse a list of JSON objects to separate columns?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-parse-a-list-of-JSON-objects-to-separate-columns/m-p/480282#M72473</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/32399"&gt;@Lovisa&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Depending on which version of JMP you are using you can import the JSON file directly into JMP using the File Open command.&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Import JSON File--&amp;gt;Open" style="width: 923px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/41876i7B053BAB8108F651/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2022-04-19 at 10.48.15 AM.png" alt="Import JSON File--&amp;gt;Open" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Import JSON File--&amp;gt;Open&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Import JSON Red Triangle Option Tall Format" style="width: 926px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/41873i792C85C8149C307B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2022-04-19 at 10.48.26 AM.png" alt="Import JSON Red Triangle Option Tall Format" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Import JSON Red Triangle Option Tall Format&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Select the "Tall guess" option from the red triangle menu option.&lt;/P&gt;
&lt;P&gt;And after clicking OK you get the JMP data table with a source script that you can reuse as needed for importing additional files.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Open(
	"$Desktop/example_json.json",
	JSON Settings(
		Stack( 0 ),
		Row( "/root/externalData" ),
		Col(
			"/root/externalData/orderNumber",
			Column Name( "orderNumber" ),
			Fill( "Use Once" ),
			Type( "Numeric" ),
			Format( {"Best"} ),
			Modeling Type( "Continuous" )
		),
		Col(
			"/root/externalData/batchNumber",
			Column Name( "batchNumber" ),
			Fill( "Use Once" ),
			Type( "Character" ),
			Format( {"Best"} ),
			Modeling Type( "Continuous" )
		),
		Col(
			"/root/externalData/partNumber",
			Column Name( "partNumber" ),
			Fill( "Use Once" ),
			Type( "Numeric" ),
			Format( {"Best"} ),
			Modeling Type( "Continuous" )
		)
	),
	JSON Wizard( 0 )
)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;cheers,&lt;/P&gt;
&lt;P&gt;Stan&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2022 15:05:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-parse-a-list-of-JSON-objects-to-separate-columns/m-p/480282#M72473</guid>
      <dc:creator>stan_koprowski</dc:creator>
      <dc:date>2022-04-19T15:05:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse a list of JSON objects to separate columns?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-parse-a-list-of-JSON-objects-to-separate-columns/m-p/480286#M72474</link>
      <description>&lt;P&gt;Have you tried the different options JSON Import Wizard provides you with? Here is for example Wide Guess with Stack enabled:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_2-1650380734917.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/41877i710FFA5B58410B43/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_2-1650380734917.png" alt="jthi_2-1650380734917.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do you want the data to look like?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2022 15:05:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-parse-a-list-of-JSON-objects-to-separate-columns/m-p/480286#M72474</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-04-19T15:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse a list of JSON objects to separate columns?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-parse-a-list-of-JSON-objects-to-separate-columns/m-p/480577#M72500</link>
      <description>&lt;P&gt;Thanks for your reply! I've tried the different options in the import wizard but I would like to separate the list into different columns not rows as in your solution. Is there a way to do that?&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2022 10:15:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-parse-a-list-of-JSON-objects-to-separate-columns/m-p/480577#M72500</guid>
      <dc:creator>Lovisa</dc:creator>
      <dc:date>2022-04-20T10:15:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse a list of JSON objects to separate columns?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-parse-a-list-of-JSON-objects-to-separate-columns/m-p/480700#M72514</link>
      <description>&lt;P&gt;Depends on how you want the data to look like, it might be that JSON Wizard cannot format it like you want to.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;JSON Import Wizard with Huge Guess (Wide will most likely also work):&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_1-1650469452121.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/41913iC21FFE8FD7E1BEC5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_1-1650469452121.png" alt="jthi_1-1650469452121.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Then you can separate batchNumber to different columns:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_2-1650469503579.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/41914i677CB1B7A0300FF0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_2-1650469503579.png" alt="jthi_2-1650469503579.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or using a bit more complicated JSON Import Wizard settings:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_4-1650470122416.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/41917i6322C19F08BF4827/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_4-1650470122416.png" alt="jthi_4-1650470122416.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;And from here you can use different tools JMP offers to split/stack/transpose the data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could also leave batch.id with empty values and use that to calculate list index&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_5-1650470572441.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/41919i29BA5FC4DA777E51/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_5-1650470572441.png" alt="jthi_5-1650470572441.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If(Row() == 1, val = 0);
If(Is Missing(:batch.id),
	val,
	val
	++);
val;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Apr 2022 16:09:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-parse-a-list-of-JSON-objects-to-separate-columns/m-p/480700#M72514</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-04-20T16:09:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse a list of JSON objects to separate columns?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-parse-a-list-of-JSON-objects-to-separate-columns/m-p/571627#M78131</link>
      <description>&lt;P&gt;If my JSON data isn't a file but is a column in an existing datatable, how can I parse the JSON into separate columns? In the example screenshot below, I want to parse the "results" column out into 3 separate columns: result1, result2, result3.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="bayesfactor1_0-1669036760473.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/47511iF62AA63EA4B700B4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="bayesfactor1_0-1669036760473.png" alt="bayesfactor1_0-1669036760473.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2022 13:19:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-parse-a-list-of-JSON-objects-to-separate-columns/m-p/571627#M78131</guid>
      <dc:creator>bayesfactor1</dc:creator>
      <dc:date>2022-11-21T13:19:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse a list of JSON objects to separate columns?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-parse-a-list-of-JSON-objects-to-separate-columns/m-p/571629#M78132</link>
      <description>&lt;P&gt;Writing separate formulas for each of the results is one option&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1669037859451.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/47512i73B0CFD5C59A3130/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1669037859451.png" alt="jthi_0-1669037859451.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Parse JSON(:Column 1[1])["res1"];&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This can also be scripted to be more automatic&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2022 13:38:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-parse-a-list-of-JSON-objects-to-separate-columns/m-p/571629#M78132</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-11-21T13:38:26Z</dc:date>
    </item>
  </channel>
</rss>

