<?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: scripting &amp;quot;add row&amp;quot; with dynamic list input in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/scripting-quot-add-row-quot-with-dynamic-list-input/m-p/276664#M53698</link>
    <description>&lt;P&gt;try the options in the below script.&amp;nbsp; (Note: 2 trailing ")" were added to make the syntax correct, after&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/19530"&gt;@Bauke&lt;/a&gt; observation of the missing characters)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;rowContents2 = {"1","2","3",4};

ob[TableBox(1)] &amp;lt;&amp;lt; add row (eval(rowContents2));

// or if necessary this should force it to work

eval(parse("ob[TableBox(1)] &amp;lt;&amp;lt; add row (" || char(rowContents2) || ");"));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 03 Jul 2020 09:17:10 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2020-07-03T09:17:10Z</dc:date>
    <item>
      <title>scripting "add row" with dynamic list input</title>
      <link>https://community.jmp.com/t5/Discussions/scripting-quot-add-row-quot-with-dynamic-list-input/m-p/276654#M53695</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a TableBox as report table in my journal. I can fill this table with "add row" which as input requires a list. This works when I directly write the list values in the function. See below. When I prepare the list however upfront and parse this into the function it doesn't work anymore See second example underneath. Why? The goal is to built this "add row" into a loop with each time different information.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bauke&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// possible and working
ob[TableBox(1)] &amp;lt;&amp;lt; add row ({"1","2","3",4});

// not possible why?
rowContents2 = {"1","2","3",4};
ob[TableBox(1)] &amp;lt;&amp;lt; add row (rowContents2);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 23:31:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/scripting-quot-add-row-quot-with-dynamic-list-input/m-p/276654#M53695</guid>
      <dc:creator>Bauke</dc:creator>
      <dc:date>2023-06-09T23:31:00Z</dc:date>
    </item>
    <item>
      <title>Re: scripting "add row" with dynamic list input</title>
      <link>https://community.jmp.com/t5/Discussions/scripting-quot-add-row-quot-with-dynamic-list-input/m-p/276664#M53698</link>
      <description>&lt;P&gt;try the options in the below script.&amp;nbsp; (Note: 2 trailing ")" were added to make the syntax correct, after&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/19530"&gt;@Bauke&lt;/a&gt; observation of the missing characters)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;rowContents2 = {"1","2","3",4};

ob[TableBox(1)] &amp;lt;&amp;lt; add row (eval(rowContents2));

// or if necessary this should force it to work

eval(parse("ob[TableBox(1)] &amp;lt;&amp;lt; add row (" || char(rowContents2) || ");"));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jul 2020 09:17:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/scripting-quot-add-row-quot-with-dynamic-list-input/m-p/276664#M53698</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-07-03T09:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: scripting "add row" with dynamic list input</title>
      <link>https://community.jmp.com/t5/Discussions/scripting-quot-add-row-quot-with-dynamic-list-input/m-p/276752#M53721</link>
      <description>&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The first didn't work. The second solution did work when adding 2 missing brackets at the end. I do not understand yet why it works, however perhaps I will find that out later.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bauke&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jul 2020 06:48:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/scripting-quot-add-row-quot-with-dynamic-list-input/m-p/276752#M53721</guid>
      <dc:creator>Bauke</dc:creator>
      <dc:date>2020-07-03T06:48:00Z</dc:date>
    </item>
    <item>
      <title>Re: scripting "add row" with dynamic list input</title>
      <link>https://community.jmp.com/t5/Discussions/scripting-quot-add-row-quot-with-dynamic-list-input/m-p/276766#M53726</link>
      <description>&lt;P&gt;The reason it works, is what the code is simply doing, is building the exact JSL needed into a character string, and then using the Eval(Parse(…….)) to tell JMP to submit the character strings value to JMP.&lt;/P&gt;
&lt;P&gt;If you take your specific example, the hard coded syntax to accomplish what you want is&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;ob[TableBox(1)] &amp;lt;&amp;lt; add row ({"1", "2", "3", 4});&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So, if one can build the above line of code into a character string, the character string can then be submitted to JMP using the Eval(Parse()) combination of functions.&amp;nbsp; Here is a simple expansion of your script to hopefully make this clear&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;rowContents2 = {"1","2","3",4};

// Create a character string variable with the required syntax
myString = "ob[TableBox(1)] &amp;lt;&amp;lt; add row (" || char(rowContents2) || ");";

// Write the string to the log to show what it looks like
show( myString );

// Run the character string variable
Eval( Parse( myString ) );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jul 2020 09:48:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/scripting-quot-add-row-quot-with-dynamic-list-input/m-p/276766#M53726</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-07-03T09:48:16Z</dc:date>
    </item>
  </channel>
</rss>

