0

Trying to automate a Google sheet to save time for a team member. I have zero scripting experience. I am trying to insert a row based on a "Yes" result from column K in a Google form submission sheet and then move data in cells L:P to the new row, all without messing up the query functions that are pulling this data.

Is this possible?

player0
  • 99,092
  • 8
  • 51
  • 98

1 Answers1

0

Appending selected data from a form submission

function onFormSubmit(e) {
  var ss=SpreadsheetApp.openById('SpreadsheetID');
  var sh=ss.getSheetByName('Sheet Name')
  if(e.values[11]=="Yes") {
    var nV=e.values.slice(11,16);
    ss.appendRow(nV);
  }
}

Since you said that you have zero scripting experience, I should warn you that you cannot run this function without supplying the event object and personally I would never append new rows to a linked sheet. I would append the rows to another sheet instead. There have been problems with the onFormSubmit trigger lately which causes spurious additional triggers as described here.

Cooper
  • 48,630
  • 6
  • 20
  • 48