This function in a google sheet does popup a window with the form, but the submit button is dead. What is missing that will make this window a live one?
function launchForm() {
var formID = '1YznrnFFIfXLpsZfsIZ4xjhlwmi8eLv_nTuOjDKGhwIc';
var form = FormApp.openById(formID);
var formUrl = form.getPublishedUrl();
var response = UrlFetchApp.fetch(formUrl);
var formHtml = response.getContentText();
var htmlApp = HtmlService
.createHtmlOutput(formHtml)
.setSandboxMode(HtmlService.SandboxMode.IFRAME)
.setTitle('Ta Daaa!')
.setWidth(500)
.setHeight(650);
SpreadsheetApp.getUi().showModalDialog(htmlApp, 'Query window');
}
The function is hooked to a menu item and clicking on that item does bring up the form over the sheet, as does running the script from the script project attached to the sheet.
menuEntries.push({name: "Launch Query form", functionName: "launchForm"});
This particular form is simple, only three fields. So I could consider using HTML service to build an HTML and I see lots of questions about that not working either, so I can probably work that out. However, I have other forms that are a lot more complex and being able to simply call a regular Google form from within the spreadsheet is what I'd rather do.
Embed the URL of the Google Form into the HTML of the dialog box:
Code.gs
InputForm.html
In "New" Google Forms you can get the IFRAME tag to embed the Google Form by clicking the "Send" button at the top right, and then clicking the third tab "<>"