Additional help with the John Stewart Twine Game Data to Google Sheets

Twine Version:2.3.12
Story Format: Harlowe 3.2.1

I have seen this question asked on quite a few twine forums or wikis and I have honestly tried to follow the advice in all of them but I am certain I am missing something simple so if anyone has any time to check and let me know what I am doing wrong I would really appreciate it!

I have followed the John Stewart guide and my current game has this -

Javascript panel-
if (!window.harlowe){
window.harlowe = {“State”: State};

Final game passage-
(set: $gameTimerActive to false)(set: $displayTime to $gameTimer)(set: $minutes to (floor: $displayTime / 60))(set: $seconds to ($displayTime % 60))

$playername you have played for $minutes minutes and $seconds seconds!

Enter your email address to submit your results!
(input-box: bind $email, “X===”, 1)
(link-repeat: “End”)[
(if: $email is not “”)[

Link to google sheets document where I have copied and pasted the John Stewart text and deployed it as a web app- New BritSciFi tracker - Google Sheets

I think that should be everything and just to clarify the playername variable is set much earlier and that is why it is not set on this passage.

Hope that all makes sense and any help would be amazing! Thanks

What’s the problem you’re having with it? Does it not send the data, or does it save the wrong data, or does it show an error, or something else?

Sorry! I should have said I have never been able to send any data at all the sheet always remains blank.

The Google macro returns a non-specific error (just says “exception”) so there’s something wrong with how the spreadsheet is set up. Unfortunately not possible to tell what it is because the error is so vague.

Sorry for the delayed reply! Thank you for looking into this for me!

Does this mean the issue is with the original John Stewart code I have copied and pasted into the google sheets editor to deploy it as a web app?

I will assume you mean this article, or at least a forum post that is based on it.

That article was published in 2017, and unfortunately since then Google has changed how the underline technologies being used work. In particular how access to the sheets is handled.

I personally don’t have an answer to how to get that method working again.

Thank you for letting me know!

I had hoped I was just missing something but if it doesn’t work anymore then I can at least stop looking into that approach.

I host the game on my own website so was wondering if you knew of any way to send the variables from twine as an email in a similar way to how a contact form is set up?

You could use an AJAX call to POST the data to your server, and have a script running on that server that knows what to do with that data when it arrives.

There are many many articles on the web covering this topic, using different server side technologies (like PHP,, Node, etc…) to run the script required to listen for the HTML POST request. Which technology you use would depending on your server’s setup and what you’re comfortable using.

eg. W3 Schools has an example of how to use AJAX to send such a POST.

Thanks Greyelf!

I shall have a look into this as a solution hopefully this weekend!