This solution demonstrates how to interact with the new Google Forms API directly from Apps Script using REST calls, not the native Apps Script Forms Service.
- Enable the Forms API for your Google Cloud project
-
Create a new blank Apps Script project.
-
Click Project Settings, then:
- Check Show "appsscript.json" manifest file in editor.
- Enter the project number of the Google Cloud project that has the Forms API enabled and click Change project.
-
Copy the contents of the Apps Script, HTML and JSON files into your Apps Script project.
-
Edit the
FormsAPI.gs
file to customize the constants.-
formId
: Choose aformId
from an existing form. -
topicName
: Optional, if using watches (pub/sub).Note: Further project setup is required to use the watch features. To set up pub/sub topics, see Google Cloud Pubsub for additional details.
-
-
Deploy the project as a Web app, authorize access and click on the deployment URL.