<?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: JSON code returning unwanted curly braces in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JSON-code-returning-unwanted-curly-braces/m-p/697838#M88325</link>
    <description>&lt;P&gt;You will have to add additional index at the end of your return value [1] (or use other method of getting the value from the list which is returned). This is because you are using matrix as the index -&amp;gt; return value will also be matrix (or in this case a list)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Loc Sorted( [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], :Age )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You could also make the above part of your script to return only single value instead of matrix&lt;/P&gt;</description>
    <pubDate>Tue, 14 Nov 2023 10:20:20 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2023-11-14T10:20:20Z</dc:date>
    <item>
      <title>JSON code returning unwanted curly braces</title>
      <link>https://community.jmp.com/t5/Discussions/JSON-code-returning-unwanted-curly-braces/m-p/697735#M88316</link>
      <description>&lt;P&gt;Hi, I am hoping to get returned numbers only, though am getting results like: -&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;{1.6853394618}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Can anyone help re-write this: -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;{1.6853394618, 1.1953542099, 0.5582366613, 0.4790270411, 0.4159308661, 0.4145532579, 0.3847474328, 0.1964273334, 0.1680691329, 0.1715601671,&lt;BR /&gt;0.2542918024, 0.1972811076, 0.2371273713}[Loc Sorted( [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], :Age )]&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;JMP 17.2.0&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2023 07:19:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSON-code-returning-unwanted-curly-braces/m-p/697735#M88316</guid>
      <dc:creator>Mick1</dc:creator>
      <dc:date>2023-11-14T07:19:24Z</dc:date>
    </item>
    <item>
      <title>Re: JSON code returning unwanted curly braces</title>
      <link>https://community.jmp.com/t5/Discussions/JSON-code-returning-unwanted-curly-braces/m-p/697838#M88325</link>
      <description>&lt;P&gt;You will have to add additional index at the end of your return value [1] (or use other method of getting the value from the list which is returned). This is because you are using matrix as the index -&amp;gt; return value will also be matrix (or in this case a list)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Loc Sorted( [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], :Age )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You could also make the above part of your script to return only single value instead of matrix&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2023 10:20:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSON-code-returning-unwanted-curly-braces/m-p/697838#M88325</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-11-14T10:20:20Z</dc:date>
    </item>
    <item>
      <title>Re: JSON code returning unwanted curly braces</title>
      <link>https://community.jmp.com/t5/Discussions/JSON-code-returning-unwanted-curly-braces/m-p/699555#M88443</link>
      <description>&lt;P&gt;Thank you Jarmo.&amp;nbsp; I have tried your suggestions, though no success as I am likely mis-interpretating them (I am a beginner at this).&amp;nbsp; Could you give the entire code?&lt;/P&gt;</description>
      <pubDate>Fri, 17 Nov 2023 01:38:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSON-code-returning-unwanted-curly-braces/m-p/699555#M88443</guid>
      <dc:creator>Mick1</dc:creator>
      <dc:date>2023-11-17T01:38:19Z</dc:date>
    </item>
    <item>
      <title>Re: JSON code returning unwanted curly braces</title>
      <link>https://community.jmp.com/t5/Discussions/JSON-code-returning-unwanted-curly-braces/m-p/699652#M88448</link>
      <description>&lt;P&gt;This hopefully gives the idea what I mean&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");
Row() = 1; 

my_list = {1.6853394618, 1.1953542099, 0.5582366613, 0.4790270411, 0.4159308661, 0.4145532579,
0.3847474328, 0.1964273334, 0.1680691329, 0.1715601671, 0.2542918024, 0.1972811076, 0.2371273713
};

m = my_list[Loc Sorted([3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], :Age)];
val = my_list[Loc Sorted([3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], :Age)][1];
val2 = my_list[Loc Sorted([3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], :Age)[1]];

Show(m, val, val2);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 17 Nov 2023 05:59:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSON-code-returning-unwanted-curly-braces/m-p/699652#M88448</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-11-17T05:59:55Z</dc:date>
    </item>
    <item>
      <title>Re: JSON code returning unwanted curly braces</title>
      <link>https://community.jmp.com/t5/Discussions/JSON-code-returning-unwanted-curly-braces/m-p/701690#M88624</link>
      <description>&lt;P&gt;Just re-starting&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;'s suggestion in a single line, if you know you are are only going to ask for a single value, you can just add [1] to the end of your line, like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;{1.6853394618, 1.1953542099, 0.5582366613, 0.4790270411, 0.4159308661, 0.4145532579, 0.3847474328, 0.1964273334, 0.1680691329, 0.1715601671,
0.2542918024, 0.1972811076, 0.2371273713}[Loc Sorted( [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], :Age )][1];&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Nov 2023 23:26:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSON-code-returning-unwanted-curly-braces/m-p/701690#M88624</guid>
      <dc:creator>ih</dc:creator>
      <dc:date>2023-11-21T23:26:12Z</dc:date>
    </item>
  </channel>
</rss>

