I’m looking for a code with will allow me to move a row from Form Responses to specific sheet. I know that can be done by filters and formulas but that won’t work for me as this will be edited in the future by 3rd person.
I have a code to move a row from one to another but only triggers when change is done ( onedit ) + dropdown list, other way is not working.
function Move_New_Data(e) {
var source = e.source.getActiveSheet();
var range = e.range;
var col = range.getColumn();
var row = range.getRow();
var val = range.getValue();
if (col == 2 && val != ''){
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName(source.getName());
var targetsheet = ss.getSheetByName(val);
var data = sheet.getRange(row,1,1,sheet.getLastColumn()).getValues();
targetsheet.appendRow(data[0]);
sheet.deleteRow(row);
}
}
Is there anything I can change here to make it work by submitting the google form and will be moved automatically?
Code need to move a whole row based on cell 2 to specific sheet for example: Column 2 will say A then code will move entire row from Form Responses to Sheet called A.
Thank you for your help.