PennController.GetTable

PennController.GetTable( tablename )

Refers to a table, where tablename can be the filename of a CSV file you uploaded to Resources (chunk_includes) or the name of a table that was created with AddTable.

You would typically use GetTable within Template when your project contains more than one table and/or when you need to use only a subset of a table, using GetTable().filter.

Example:

[js highlight=”1″ try=”data”]
Template( GetTable( “spreadsheet.csv” ) , row =>
newTrial( “button trial” ,
newButton(“test button”, row.ButtonText)
.print()
.wait()
)
.log( “Group” , row.Item )
.log( “Text” , row.ButtonText )
);
[/js]

Generate two trials from the table spreadsheet.csv which contains two rows and the columns Item and ButtonText.