const ss = SpreadsheetApp.getActiveSpreadsheet();
// collect data.
const sourcerange = ss.getRangeByName("b94:h94");
const sourceVals = sourcerange.getValues();
// skip val, gather user email
const email = Session.getActiveUser().getEmail();
const data = {email,sourceVals};
console.log(data);
//append data
const destinationsheet = ss.getSheetByName("test log");
destinationsheet.appendRow(data);
edit: error happening here
const destinationsheet = ss.getSheetByName("test log");
destinationsheet.appendRow(data);
here is the error message
Exception: The parameters ((class)) don’t match the method signature for SpreadsheetApp.Sheet.appendRow.
myFunctionx @ Code.gs:19
2
Answers
If you want the email address of the person that ran the script to be the first value of the row that will be pasted into test log. Try this:
Try it this way: