I have a Google Spreadsheet with full access.
And I want to add new content to the Google Spreadsheet using p5js.
Can I…? What should I do?
I have a Google Spreadsheet with full access.
And I want to add new content to the Google Spreadsheet using p5js.
Can I…? What should I do?
You should use the API that Google has provided.
You can do it using Node.js, so you should be able to do it using p5.js too.
I’d start here: https://codelabs.developers.google.com/codelabs/sheets-api/#0
Sheetsu can be good for this. You give it a (public) google spreadsheet URL and it gives you JSON that its easily compatible with loadJSON in p5. It’s very easy to use, but the downside is that after your free trial expires, you need to purchase a subscription and it is not cheap.
I went into the link and looked at it, but it’s not easy for me.
It’s my scenario.
Is this possible with the API provided by Google?
Is it possible? Yes, it should be.
I suggest you follow the tutorial as it is, and only add Processing to it AFTER you have a node.js application working & communicating with Google Sheets.
It’s a ton of effort though.
Does your sketch really need a global high scores table? A local one is much easier to do…
The “easiest” way is embed p5 in Apps Script like this…
…and make calls to your backend spreadsheet with google.script.run like this…
https://developers.google.com/apps-script/guides/html/reference/run
Not p5.js, but you can do this without writing custom code using https://sheet2api.com/ . Also works for Excel Online but haven’t tried that yet.