HTML form to Google Sheet

I’ve been trying to figure out how to do this for a while so maybe it will be useful to someone else. I want to create an HTML form here that sends all the inputs to a google sheet. Demo:

Here is the form:

First Name:

Last Name:


This is where the confirmation message will appear after submission.

And it all ends up in that sheet.

Worked? So here is how to do it:

First, quite obviously, you need and HMTL form. Here's mine:

We'll need to update the link_to_google_script thing after next step.

Then we need a Google Sheet. Go to your Google Drive, create one and save its ID somewhere (that the long string in the url between d/ and /edit).

Now, still in Google Drive, create a new Google Apps Script, remove any code in there and relace it with this:

Just replace the id_of_your_google_sheet with the ID of your own sheet.

Once done, save you script, select Publish, Deploy as web app, make sure that "anyone, even anonymous" has access to the app and Publish. After a bit of authorization procedures, you should get this:

Copy that link and paste it in your HTML instead of link_to_google_script then add at the bottom of your HTML page:

Here you go, it should be working!

Aucun commentaire:

Enregistrer un commentaire

ChallengeR #8 - Solutions

Votre mission consistait donc à trouver un moyen de faire en sorte que : > x == 0 [1] TRUE > x + 1 == 2 [1] TRUE > x / 2 == 1 [1...