I need help please - here's a little history..
I have a google schedule - https://docs.google.com/spreadsheet/ccc?key=0ArmKEmhue9OgdEFwMHBldFpGenNVdzJUQThCQU9Qcmc&usp=sharing
Within that schedule there are numerous sheets but the ones that I was hoping to get help with is the Form Responses 1 and PROJECTS sheet
I have a google form - https://docs.google.com/forms/d/1yFy3i5H3abhFjdvchuJq2ARODcfRGo6KNkOAgeRIMMU/viewform
It's linked to the google schedule and with each submission the data goes in the Form Responses 1 sheet -
There is a script applied to the spreadsheet -
COPYING TO/FROM SCRIPT
/**
* A function named onEdit will be called whenever
* a change is made to the spreadsheet.
*
* @param {object} e The edit event (not used in this case)
*/
function onFormSubmit(e){
var copyFromRange = 'Form Responses 1!A2:AC999';
var copyToRangeStart = 'PROJECTS!A71:AC999';
copyValuesOnly(copyFromRange, copyToRangeStart);
}
/**
* This function will copy the values from a given range to
* a second range, which starts from the given cell reference
*
* @param {string} copyFromRange Range reference eg:
* @param {string} copyToRangeStart Cell reference eg:
*/
function copyValuesOnly(copyFromRange, copyToRangeStart) {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var source = ss.getRange(copyFromRange);
source.copyTo(ss.getRange(copyToRangeStart), {contentsOnly: true});
}
This is allowing the data to copy over to the PROJECTS sheet so multiple users can edit and update BUT realized that it overrides the data each time a new submission comes in
Also just to note within the Form Responses 1 sheet under column C "Project Number" there is a forumula =ArrayFormula("MC"&TEXT(ROW(A2:A)-1 ; "000") ) that I placed to allow for automatically numbering each submission with a project number
I also have a ARCHIVE script -
Once a project is final, under column G "Archive" if you type "DONE" it then moves to the ARCHIVE sheet
function onEdit() {
// moves a row from a sheet to another when a magic value is entered in a column
// adjust the following variables to fit your needs
// see https://productforums.google.com/d/topic/docs/ehoCZjFPBao/discussion
var sheetNameToWatch1 = "PROJECTS";
var sheetNameToWatch2 = "ADVERTISING";
var columnNumberToWatch = 7; // column A = 1, B = 2, etc.
var valueToWatch = "DONE";
var sheetNameToMoveTheRowTo = "ARCHIVE";
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = SpreadsheetApp.getActiveSheet();
var range = sheet.getActiveCell();
if ( (sheet.getName() == sheetNameToWatch1 || sheet.getName() == sheetNameToWatch2) && range.getColumn() == columnNumberToWatch && range.getValue() == valueToWatch) {
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());
}
}
ISSUES -COPYING - When a new submission is entered using the form, the data comes in Form Responses 1 sheet and then copies to PROJECTS sheet BUT you cannot edit the data under PROJECTS because each submission overrides any edits and brings in the original form submission data -
What I would like to have happen is the data comes in Form Responses 1 sheet then copies to PROJECTS sheet on each submission but then does not override when a new submission comes in and any changes to the data under PROJECTS stays there
ISSUES - PROJECT NUMBER - the formula setup under Form Responses 1 sheet under column C row 2 - each row has a project number assigned and then it copies to the PROJECTS sheet, when the row is then archived ("DONE) and moves to the ARCHIVE sheet the project number assigned to that row goes with it BUT when you submit a new project the same number can be applied to a new project so then ultimately when you archive all the projects many will have the same project number, is there a way to make each project have a unique project number?
*ISSUES - SUBMIT FORM * - I am not sure why but when a new submission comes in the data is coming in at row 113 each time, not at the end of the form responses rows?
Any help would be greatly appreciated - I thought it was going to work but seems the script isn't the right setup for what I would like it to do
Thanks so much, Paola G