function doPost(e) {
// Get the active spreadsheet and the first sheet
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
// Get the form data from the POST request
var formData = e.parameter;
// Add a timestamp to the data
var timestamp = new Date();
// Get the values from the form. These names must match the 'name' attributes in your HTML.
var clientName = formData.clientName;
var clientAddress = formData.clientAddress;
var clientPhoneNumber = formData.clientPhoneNumber;
var clientEmail = formData.clientEmail;
var serviceRequested = formData.serviceRequested;
var agentName = formData.agentName;
// Append a new row with the data to the sheet
sheet.appendRow([
timestamp,
clientName,
clientAddress,
clientPhoneNumber,
clientEmail,
serviceRequested,
agentName
]);
// Return a success message to the form
return ContentService.createTextOutput("Success").setMimeType(ContentService.MimeType.TEXT);
}
EZ Home Service Vendor Connection

