Our company has made a form with Typeform. Is it possible to trigger the onSubmit event when a new response is sent to the spreadsheet from the Typeform form? Or is there some other way to detect new responses in the spreadsheet?
5 Answers
Is it possible to trigger the onSubmit event when a new response is sent to the spreadsheet from the Typeform form?
You can't do that. Google Forms and Typeform are two different platforms with different mechanisms. The onSubmit
event of a google form cannot be made to work with Typeform.
You can write a script to 'poll' the Typeform API (as others have suggested) but there is a more efficient way to achieve what you require.
You'll need to leverage Typeform's Webhook API in tandem with a webhook endpoint. You can deploy a stand-alone apps script as a web app and use it's URL as an endpoint for webhook payloads. The script can then be made to process Typeform submission data and place it into a Google Sheet.
The onSubmit()
event has to do with Google Forms, but Typeform does not go through Google Forms.
Instead, you should write a Script that fires from your connected Spreadsheet. However, the onEdit()
trigger will not work because the user needs to be logged in for it to work. To work around that, you can write a script that checks every, say, 15 minutes to detect any changes in your Google Sheet.
Then you can trigger some actions to run whenever new data has been added to your Google Sheet.
Typeform offers a native integration with Google Spreadsheet, you can turn it on directly from the Integrate
tab. The steps are described here as well.
Every time a new answer is submitted to your typeform it will be added on your google spreadsheet.
There you can have a script to listen to changes and react to it.
As Dimu mentioned, using Typeform webhook will give you a lot more flexibility.
It turns out Typeform has a ready made integration with Zapier to post Typeform answers to Slack. This way you can just click through the process and not have to write a single line of code.
Here it is: https://zapier.com/app/editor/template/883