I would like to use Google Forms in my webapp to run quizzes.

  1. The Google Form is created.
  2. I use the pre-fill option to get a URL.
  3. From my web app I create an iframe and pass the URL (different for each user) by passing the user-id to the form.
  4. User now fills the form and submits.
  5. The data is stored in a spreadsheet.
  6. Earlier I publish the spreadsheet (thereby making it public).
  7. I can now access the spreadsheet data and update my local database.

So currently, when the user submits (from within Google Form) there is no way my web app knows about it. (I have browsed the internet for solutions but did not find any).

Is there a way to get around this?

Currently, at some "stage" in the web app, I check if the user form data is available in the database. If not, I check the spreadsheet for that user data. If found, update the webapp database. So in that sense the webapp uses a pull-feature to check for updates.

Thanks

1

Best Answer


I see that you want to know when a new Form response has been uploaded. If my understanding of the question is correct, then you could use a simple .onEdit() trigger in the response Sheet. As an alternative, you could use a FormResponse.submit() installable trigger that fires at each response. Please keep in mind that triggers are limited to form uploads that don't fire from API requests and script executions, as detailed here. Please, don't hesitate to ask for further clarification.


UPDATE

Based on your last comment I get that your priority is to see the response Sheet updated in real time. If my understanding of the issue is correct, then you can show the responses Sheet directly in a webapp inside an iframe. Please, ask me any question if you have doubts about this approach.