Skip to content

Sending form data to a Google Sheet allows you to collect and organize information submitted through a web form directly into a spreadsheet.

Notifications You must be signed in to change notification settings

RanjanWorks/SHEETFORM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Send Form Data to google Sheet

Sending form data to a Google Sheet allows you to collect and organize information submitted through a web form directly into a spreadsheet. By integrating Google Apps Script with your HTML form, you can capture user input and append it to a specific sheet within your Google Sheets document. This process streamlines data collection, enabling efficient analysis and management of responses.

Screenshot

App Screenshot

Demo

Pages

Sheet Script

let sheet = SpreadsheetApp.openByUrl(SheetLink);
let sheetName = sheet.getSheetByName('Sheet1');
function doPost(e){
  let data = e.parameter;
  sheetName.appendRow([data.COURSE, data.NAME, data.EMAIL, data.PHONE, data.ADDRESS, data.MESSAGE, data.GENDER]);
  return ContentService.createTextOutput('data saved');
}

JAVASCRIPT CODE

let form = document.querySelector("#form");
let url 'DEPLOY URL';
form.addEventListener("submit", (e) => {
  e.preventDefault();
  init()
  let formData = new FormData(form);

  fetch(url, {
    method: "POST",
    body: formData,
  })
    .then((res)=>res.text())
    .then((data)=>{
  //DO STUFF HERE
    })
    .catch((error) => {
      console.error("Error:", error);
    });
});

About

Sending form data to a Google Sheet allows you to collect and organize information submitted through a web form directly into a spreadsheet.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published