Hello there actually im new using this Apps scripts and trying to build something that can be achieve with spreadsheet. The problem is when i submit new data to a second form the output is below the new data.,
here the code: Code.gs
function processForm(input1, input2, input3) {
var sheet = SpreadsheetApp.getActiveSheet();
var range = sheet.getRange("B4:D4");
range.setValues([[input1, input2, input3]]);
var values = range.getValues();
var lastRow = sheet.getLastRow();
var nextRow = lastRow + 1;
sheet.insertRowAfter(lastRow);
sheet.getRange(nextRow, range.getColumn(), 1, 3).setValues([[input1, input2, input3]]);
return true;
}
function processForm1(input4, input5, input6) {
var sheet = SpreadsheetApp.getActiveSheet();
var range = sheet.getRange("G4:I4");
range.setValues([[input4, input5, input6]]);
var values = range.getValues();
var lastRow = sheet.getLastRow();
var nextRow = lastRow + 1;
sheet.insertRowAfter(lastRow);
sheet.getRange(nextRow, 7, 1, 3).setValues([[input4, input5, input6]]);
return true;
}
i have try many option but still cant figure it out., the row is still follow the lastrow of processform.
refer the image what im trying to achieve