I'm attempting to write a few functions that
- copy google form submission to from "form submission" sheet to "All Leads" sheet
- move whole row from "All Leads" sheet to "Open Leads" sheet based on a cell value = "open"
- move whole row data either back to "All Leads" or "closed","lost" sheets based on cell value ="closed/lost/blank"
var sheetNameToWatch = "Form Responses";
var columnNumberToWatch = 3;
var sheetNameToMoveTheRowTo = "All Leads";
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = SpreadsheetApp.getActiveSheet();
var range = sheet.getActiveCell();
if (sheet.getName() == sheetNameToWatch && range.getColumn() == columnNumberToWatch && isBlank(range) == FALSE) {
var targetSheet = ss.getSheetByName(sheetNameToMoveTheRowTo);
var targetRange = targetSheet.getRange(targetSheet.getLastRow() + 1, 1);
sheet.getRange(range.getRow(), 1, 1, sheet.getLastColumn()).moveTo(targetRange);
//sheet.deleteRow(range.getRow());
}
}
But I'm not getting this to trigger onEdit or onFormSubmission. Any help is appreciated, and as you can tell i'm new to scripting.
Here is the shared google spreadsheet
https://docs.google.com/spreadsheets/d/13090GHrXY17lRzA9ppQHZZGyT9yUNk6hMMXDQIKmddI/edit?usp=sharing
I'm not getting this to trigger onEdit or onFormSubmission.
. Can I ask you about the detail of it? And also, can I ask you about your current issue of your script? – Tanaike