I have four user input text fields in html created to user input data. I want to pass this four values into Google spreadsheet. This HTML is created using Google script. I am no
This is a simple html file communicating with Google Apps Script contained in a Spreadsheet. The html file and the Google Apps Script communicate with each other and I pass one array from the html file to the Google Script. Hope this helps.
The Code.gs file:
function doGet()
{
var html = HtmlService.createHtmlOutputFromFile('index');
return html.setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL)
}
function getData(a)
{
var ts = Utilities.formatDate(new Date(), "GMT-6", "M/d/yyyy' 'HH:mm:ss");
a.splice(0,0,ts);
var ss=SpreadsheetApp.openById('SPREADSHEETID')
ss.getSheetByName('Form Responses 1').appendRow(a);
return true;
}
function getURL()
{
var ss=SpreadsheetApp.openById('SPREADSHEETID');
var sht=ss.getSheetByName('imgURLs');
var rng=sht.getDataRange();
var rngA=rng.getValues();
var urlA=[];
for(var i=1;i
The index.html file:
Text 1
Text 2
Text 3
Text 4
Member
Guest
Intruder