Hello,
I have a google form on codepen that I would like to have import the responses to Excel automatically after the user submits. How would I go about doing that?
Edit: I think I misunderstood your question entirely. I’m not familiar with Google Forms, but a quick Google search pulls up this:
Choose where to save form responses
When you send a form, you can gather the responses inside the form or separately in Google Sheets.
Google Sheets uses formats compatible with MS Excel.
Original answer
Old skool method (no libraries required): export to .csv
(comma separated values) format using a data URI.
A couple of gotchas:
- Don’t add spaces after the comma delimiters.
- Remember to enclose any fields containing commas, quotation marks, or newlines with quotation marks.
- Escape literal quotation marks with another quotation mark (
""like this""
). - Always start the data content with the character
\uFEFF
if you want your exported file to display unicode content properly. - Delimit rows with CRLFs (
'\r\n'
).