Hi,
I am trying more scripting in Seatable and I am trying to do a nested FOR loop but it does not want to work. Does Seatable not support nested FOR statements? I am following the same structure as it would be in Java script.
Below is my code and also screenshots of my data:
var date = new Date();
let today = base.utils.formatDate(date);
output.text(today);
const copyTableName = 'Personnel';
const copyViewName = 'Default View';
const copyColumnName = 'Name';
const copyColumnEmail = 'Email';
const pasteTableName = 'Tasks';
const pasteViewName = 'Default View';
const pasteColumnName = 'Name';
const pasteColumnEmail = 'Email';
const Table = base.getTableByName(copyTableName);
const View = base.getViewByName(Table, copyViewName);
const Rows = base.getRows(Table, View);
const outputTable = base.getTableByName(pasteTableName);
const outputView = base.getViewByName(outputTable, pasteViewName);
const outputRows = base.getRows(outputTable, outputView);
for (let i = 0; i < Rows.length; i++) {
for (var a = 0; a < outputRows.lenght; a++) {
output.text("Personal "+i);
output.text("Tasks "+a);
}
};
output.text(today);
output.text("end");
At the moment, all I am trying to do is get it to display the number of rows it counts. It returns nothing. If I break it down it down so that its not a nested FOR loop it works fine.
Image1:
Image2: