Kostas Georgokitsos
Kostas Georgokitsos

Reputation: 389

Google Forms, sidebar for live form

I would like to create a sidebar to a live google form, ideally in order to pick from a (google) map coordinates to be entered in the form.

From the documentation and from my trials I can create a sidebar to the form editor/designer (https://docs.google.com/forms/d/ID/edit), not the live form itself (https://docs.google.com/forms/d/ID/viewform). Forms are different in regard to the Doc and Sheet Apps, that there exist these two views.

For example:

function onOpen() {
  var ui = HtmlService.createHtmlOutputFromFile('Sidebar')
      .setTitle('Maps');
  FormApp.getUi().showSidebar(ui);
}

First problem is that the trigger for onOpen() fires when opening the form designer, not when the end user will open the form (/viewform URL) to fill it out.

Then FormApp.getUI().showSidebar(ui); gets the UI of the forms designer and opens up a sidebar there and not in the Form the end user has to fill out.

Documentation seems to confirm this.

So, is it possible to get access to the live form, including any associated triggers?

Upvotes: 1

Views: 633

Answers (1)

Mogsdad
Mogsdad

Reputation: 45720

So, is it possible to get access to the live form, including any associated triggers?

No

However, you could embed your form in a page that also hosts the map in a separate frame, enabling users to browse the map, click to see coordinates, and then copy them to the form. There would be no interaction between the google-hosted form and the map.

Upvotes: 2

Related Questions