Javascript to send Data to Google sheets

Lua Shixiong shared this question 1 year ago

Dear all in GGB community,

I am so close to materialize an idea of mine to send data from an applet to Google sheets. With the data in sheets, I could better monitor responses (perhaps Geogebra classroom may eventually be able to do this) and to link it to flippty where I could award badges.

I have been diligently following this tutorial: but after following the instructions, changing header of the google sheet and making sure the Javascript matches the headers, I am getting an Reference Error sendData is not defined error after clicking on the SEND button.

Michael and Lewws has previously given me some hints. I have followed them but again met with other errors.

Can anyone help?

Providing the links to the google sheet:

and GGB aaplet:

Many thanks in advance!

Comments (3)


I suggest you start again from the working version and make small change -> test -> make small change -> test -> etc


Hi Lua,

I was curious what happened above and did a thorough check.

Initially I was not able to detect what was wrong.

I can confirm your ggb file coding is in order.

However your Google spreadsheet set up could be faulty.

I have copied your resource and put it at

I cloned 2 spreadsheets (from my own successful Geogebra to Google Sheet recordings)

They are at



In each case, I go through the rest of the setup procedure outlined in minus the recommended coding from the web page, but using the coding from my successful files.

ie. I run "setup", deploy the code as "webapp" and Execute as "me address" and Who has access as "any one"


Each file after running setup and "deploying" it, you will be able to get the web app url for each spreadsheet.

Using your ggb file, under Global Javascript tab, for scriptURL

for sending data to the first spreadsheet 1.

the scriptURL to be pasted is

for sending data to the second spreadsheet 2

the scriptURL to be pasted is

If you want to try sending data from your own Geogebra resource, use any of the two scriptURLs (paste one at a time). After updating, upload to your online resource , try to send data from there, and then view the corresponding spreadsheets.

I suggest you keep a copy of successful spreadsheets, then duplicate them and run setup and then finally get the scriptURL for your own resource.




Hi Lua,

Your remark that "I am getting an Reference Error sendData is not defined error after clicking on the SEND button." is due to the fact that you cannot run the Global JavaScript codes in the ggb file on your desktop.

The Global JavaScript codes work only when you run a Geogebra file online using a web browser.

Hope these help you

© 2022 International GeoGebra Institute