<?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 How to get a table (small) into a list of Associatives Arrays OR how to script column name inside &amp;quot;For Each Row&amp;quot; in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-get-a-table-small-into-a-list-of-Associatives-Arrays-OR/m-p/927018#M108482</link>
    <description>&lt;P&gt;Hi all!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need to get a small table into a list of Associative Arrays. Where each row is a member of that list and is an Associative Array with column names as keys and row values as values.&lt;/P&gt;
&lt;P&gt;Currently I have this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
listAA = {};
columnList = dt &amp;lt;&amp;lt; Get Column Names( string );
For Each Row(
	currentAA = Associative Array();
	For Each( {columnName, index}, columnList, currentAA[columnName] = Column( dt, columnName ) );
	Insert Into( listAA, currentAA );
);

//Check
listAA[1]["age"]


//:*/
listAA[1]["age"]
/*:

Column( "age" )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The output is not a value, but a reference to a column. So looks like it doesn't work when you refer to column using Column(name) inside For Each Row, only hardcoded names like in the Scripting Index:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;For Each Row( :height = -:height );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Questions:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Is there a simple elegant way to get a list of AAs from a table? If not - how would I need to change my current version?&lt;/P&gt;
&lt;P&gt;2. How to refer to a column not in a hardcoded way when using "For Each Row"?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;M.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 28 Jan 2026 17:58:56 GMT</pubDate>
    <dc:creator>miguello</dc:creator>
    <dc:date>2026-01-28T17:58:56Z</dc:date>
    <item>
      <title>How to get a table (small) into a list of Associatives Arrays OR how to script column name inside "For Each Row"</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-a-table-small-into-a-list-of-Associatives-Arrays-OR/m-p/927018#M108482</link>
      <description>&lt;P&gt;Hi all!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need to get a small table into a list of Associative Arrays. Where each row is a member of that list and is an Associative Array with column names as keys and row values as values.&lt;/P&gt;
&lt;P&gt;Currently I have this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
listAA = {};
columnList = dt &amp;lt;&amp;lt; Get Column Names( string );
For Each Row(
	currentAA = Associative Array();
	For Each( {columnName, index}, columnList, currentAA[columnName] = Column( dt, columnName ) );
	Insert Into( listAA, currentAA );
);

//Check
listAA[1]["age"]


//:*/
listAA[1]["age"]
/*:

Column( "age" )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The output is not a value, but a reference to a column. So looks like it doesn't work when you refer to column using Column(name) inside For Each Row, only hardcoded names like in the Scripting Index:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;For Each Row( :height = -:height );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Questions:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Is there a simple elegant way to get a list of AAs from a table? If not - how would I need to change my current version?&lt;/P&gt;
&lt;P&gt;2. How to refer to a column not in a hardcoded way when using "For Each Row"?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;M.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jan 2026 17:58:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-a-table-small-into-a-list-of-Associatives-Arrays-OR/m-p/927018#M108482</guid>
      <dc:creator>miguello</dc:creator>
      <dc:date>2026-01-28T17:58:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a table (small) into a list of Associatives Arrays OR how to script column name inside "For Each Row"</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-a-table-small-into-a-list-of-Associatives-Arrays-OR/m-p/927037#M108483</link>
      <description>&lt;P&gt;Maybe something like this&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");

collist = dt &amp;lt;&amp;lt; Get Column Names(string);&lt;BR /&gt;
l = {};
For Each Row(
	aa = Associative Array(collist, dt[Row(), 0]);
	Insert Into(l, aa);
);

Show(l);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Jan 2026 18:26:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-a-table-small-into-a-list-of-Associatives-Arrays-OR/m-p/927037#M108483</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2026-01-28T18:26:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a table (small) into a list of Associatives Arrays OR how to script column name inside "For Each Row"</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-a-table-small-into-a-list-of-Associatives-Arrays-OR/m-p/927038#M108484</link>
      <description>&lt;P&gt;You can also save it as .json and then parse it into AA&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

path = "$TEMP/test.json";

dt = Open("$SAMPLE_DATA/Big Class.jmp");

dt &amp;lt;&amp;lt; Save(path);
json_str = Load Text File(path);
Delete File(path);

l = Parse JSON(json_str);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Jan 2026 18:33:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-a-table-small-into-a-list-of-Associatives-Arrays-OR/m-p/927038#M108484</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2026-01-28T18:33:57Z</dc:date>
    </item>
  </channel>
</rss>

