Simple data post to Google Spreadsheet - WORKS for IOS

LarsAsen

  • *
  • Posts: 144
Hello,
I dont know if this is the right board to post this and if its for anyones interest..

Anyway, since I┬┤ve been searching and trying a lot do use google Spreadsheet as a simple leaderboard (for post) at least I want to share how I finally got it to work, if someone looking for this feature.

1, Create a blank sheet at https://docs.google.com/ - name it if you want.

2, "Extension" - "App script"

3, replace the code in Code.gs with this
function doPost(e){
  var sheet = SpreadsheetApp.getActiveSheet();
  var score = e.parameter.score;
  var name = e.parameter.name;
  var month = e.parameter.month;
  var year = e.parameter.year;

 sheet.appendRow([name, score, month, year])
}


please note that im using the varibles name, score, month, year

4, "deploy" -> "new deployment" - > "web app".
execute "as me"
who as access "anyone"
"ok". if needed to

5, copy "web app URL"

6, Now go to stencyl, the the block "post data to URL"
"data" name=myname&score=123&month=February&year=2022
"url" "web app URL"

7, test game on IOS or other platform (if it works).

8. Data should be in your google sheet, see attached picture.

Best regards








Follow me on Instagram

Mineat

  • Posts: 379
I think that can be done in html5. All you need is to change the export target.

I'll try messing around with it, later...

EDIT: Does this work any attributes in the game? If so, what kind?

LarsAsen

  • *
  • Posts: 144
Hello,

regarding attributes, it works with text attributes. I think it would work with number-attributes as well .

Follow me on Instagram

Mineat

  • Posts: 379
Can it be edited or taken by someone else? Because I would love to display stats for my games on it!