I'm collecting data with a Google Form, and storing it in a spreadsheet.
I would like to write a script to create separate spreadsheet, sorted by name.
E.g.
I have three users: Daniel
, Gilles
and Jean Pierre
.
I want to create a separate sheet from the main one, listing only the data submitted.
So, if the name is Daniel
in row 2, I want to copy all the data in the row to the second sheet
So far:
function tri()
{
var ss = SpreadsheetApp.getActiveSpreadsheet();
var data = ss.getDataRange().getValues();
var sheet2 = ss.getSheets()[1];
for (var t=1; t<data.length; t++)
{
if (data ='Daniel')
{
sheet2.appendRow([data]);
}
}
}