I am trying to create a Google sheet that can read and store information from a Google form. I need this program to take the fields when the form submits and append them to my Google sheet. The code below automatically creates a sheet that holds the information from the form.
I am currently using logger to see if they are getting any of the information from the form. They are not.
How can I retrieve each value from the form and then programatically append it to a sheet I created?
function formSubmit(e)
{
// Function level variables
var date = e.values[0];
var name = e.values[1];
var phone = e.values[2];
// Get the spread sheet that contains the data
var ss = SpreadsheetApp.openById('1FpRbYC-
nfltxoalGV974aDX6A_fEy_MBYBShruRRYfM');
var sheet = ss.getSheetId(0);
if(sheet)
{
Logger.log(name);
}
else
{
Logger.log(phone)
}
// Add submission to DB
sheet.appendRow([date,name,phone]);