Create a new row entry in a google sheet with google form questions answers each time someone submits their answers

39 Views Asked by At

I have a google form with 9 questions on it getting contact information and I'd like to set up a script so that every time someone submits their responses to the form, the script runs and takes their answers and puts them in the next line of the google sheet. I then would take that new line of contact info and either update the persons contact or create a new contact. I can handle the contact creation/updated portion but am not really sure how to set up the trigger so that it runs every time someone submits a form and then grabs that new submission and puts the answers in the next empty row of the google sheet. Any advice? I'm new to the google form side of google apps scripts and am struggling to find answers.

1

There are 1 best solutions below

2
Cooper On BEST ANSWER

Appending your 9 answers to another sheet

function createANewRowFromFormSubmission(e) {//onformSubmit trigger handler function
  const ss = SpreadsheetApp.getActive();
  const sh = ss.getSheetByName("SheetName");
  const row = e.values.slice(1);
  sh.appendRow(row);
}