I have Google spreadsheet script which will show modal dialog using SpreadsheetApp.getUi().showModalDialog using a html form which is created as a file in the SpreadSheet Script project.
This is how my Google Script project structure is :
--Code.gs
|
|- openFormModalDialog()
|- fetchData()
|- updateSheet()
|
--form.html
When click button in my form.html which is showed in the modal from the Code.gs I wan to call a function in my Code.gs to process the data entered by the user in the form. I have multiple input fields in the form.
I want to access form input values to make external service call and fetch and updated sheet rows.
I am not able to figure out how to access the data in the form filed in App Script.
This is how I am opening my form:
function openFormModalDialog() {
var ui = SpreadsheetApp.getUi();
var htmlOutput = HtmlService
.createHtmlOutputFromFile('form')
.setWidth(400)
.setHeight(300);
SpreadsheetApp.getUi().showModalDialog(htmlOutput, 'User Information');
}
Is there a way I can pass my App-Script function as parameter to html? I am not able to find any relevant document related to this.
promptto take input from user to use in the app script. - Dipak