Here is my HTML file "Creds.html":
<form id="Creds">
Client ID: <input id="id" type="text" width="45"><br>
Client Secret: <input id="secret" type="password" width="45"><br>
<input id="submit" type="button" value="Submit" width="15" onclick="google.script.host.close()"><br>
</form>
Here is the Google Sheets bound Apps Script that is attempting to display it:
function setCreds () {
var ui = SpreadsheetApp.getUi();
var form_cred = HtmlService.createHtmlOutputFromFile('Creds');
//var newcreds = ui.showSidebar(form_cred);
var newcreds = ui.showModalDialog(form_cred);
...
}
The .ShowSidebar
line works when I switch the //
comment line. However, the .showModalDialog
line gives the following error:
Exception: The parameters (HtmlService.HtmlOutput) don't match the method signature for Ui.showModalDialog.
Why am I getting this error? What needs to change?