[RELEASED] Google Sheets For Unity

[GET IT AT THE STORE PAGE]

Google Sheets For Unity allows to interact with Google Drive environment, at runtime or design time.

This unlock a world of posibilities: virtually free backend, for collaboration in design and development. Customize your workflow with flexible and solid well known solutions!

With more than 5 years on the Unity Asset Store, an asset which is the result and product of actual field work, and with the accumulated experience of having thousands of users, it represents a classic and default choice for simply and efficiently connect Unity and Google Spreadsheets.

Check the online demo!

Head to the asset page, and check the WebGL demo for yourself!
Set a spreadsheet id on the input field and check how the spreadsheet is filled with content, updated, and you can change content on the sheet and check how the demo will retrieve the fresh data upon request.

Highlights:

:heavy_check_mark: Read & Write to spreadhseets (runtime and design time).
:heavy_check_mark: Upload & Download files: binary, text, images.
:heavy_check_mark: Works with desktop, mobile and WebGL.
:heavy_check_mark: Source code included.
:heavy_check_mark: No Google account credentials required on the Unity side.
:heavy_check_mark: Works with private and public Google spreadsheets.
:heavy_check_mark: Free SKDs dependencies: no Google Data API required, standard Unity UnityWebRequest calls.

Multiple barebone examples included:

  • Spreadsheets basic use.
  • Files: loading and saving from both, disk and Google Drive.
  • Images: load from disk or screenshot, save and retrieve from Google Drive.
  • Simple localization example.
  • In-Editor use demo.
  • Unity Console Logs to cloud example.
  • Session context: use a custom player login system.

How it works?

The Unity side API enables working with spreadsheets as object tables, or just cell by cell. Creating and retrieving folders, text and binary files. Saving and loading png or jpg images files.

This client connection on Unity side provides practical queries that will cover most basic interactions. It connects to a webservice which is deployed on the developers Google Drive account. The source code for both, the Unity API and the webservice are provided, enabling tweaks on the available queries, or full customization and adding new posibilities!

Documentation

Unity API docs are public and available online here.
Complete developer guide will be available with the asset in PDF format.

Disclaimmer

This package requires intermediate to advanced programming skills in order to understand and use the asset for your own purposes.

Note on the “Lite” Edition

The original version has been rebranded “Lite” edition, to denote the difference with the new asset (described on this thread). This new main version, encompasses wider use cases, including and extending capabilities that used to be scattered among 3 or 4 other assets (siblings from GSFU, that I named “CloudTools”).

In essence, the Lite version focuses exclusively on Google Spreadsheets, while the main version goes a bit beyond.

Status

Released!

[GET IT]

2 Likes

Update: API reference published: Class Drive
At this time, Im just writing the developer guide and waiting for answers from itchio regarding taxation.

2 Likes

Is it possible with this asset/package to load the data of a specific pie chart from a specific google sheet?

Hey @yoslan , I would say yes, in the sense that the data is on the sheet, while a chart is usually a mere presentation of that data. So while the asset doesnt interact with charts on google spreadsheets, do handle data on the sheet themselves. Hope it helps.

Update: Tomorrow is release day :slight_smile:
Only some last minute revisions and tests are pending, will keep you posted!

Aaaand is up!
Check the itch.io store page!

1 Like

I don’t see a way to buy the “Pro” version

Hey @EdgarasArt the one on itchi.io is the main version, at the bottom of the page you’ll found the buy button. The Lite edition is on Unity Asset Store only.

Hey, do you know why Enums don’t get deserialized when I pull them back down from the google sheet?

Hey @Xelnath , is related to UnityEngine.JsonUtility, it does not handle Enums, you’ll have to manually parse from string to enum in a post process (or int to enum, depending how you serialized it).

Now that you mention it, I will add a method to the JsonHelper class to make this operation simpler, but you’ll still need to do a post-process using it. Taking notes for next patch!

Okay. Would I be better off using a different json deserializer then?

That is also a good option, yes, although it depends highly on your specific needs, in terms of measuring simplicity and maintenance burden, againts small patches like implementing manual deserialization post process methods for each required class.

In all honestly, Im using it because for the basic use cases there are no needs to introduce extra dependencies, but JsonUtility is fairly limited and limiting, and Im anxiously waiting for some improvements mentioned by Unity staff.

If anyone has a suggestion, it would be greatly appreciated :slight_smile:

@Xelnath in my road to minimalism, before stoping on Unitys JsonUtility I used Newtonsoft Json.NET and LitJson. I can speak good of both, specially about the later, given my intent to go after the smallest possible.

Did you know…? (Tip)

Is well known (and evident) that Google sheets for Unity works with private and public spreadsheets from the Google Drive account owner.

But, it also works with any spreadsheet, no matter the google account, if the sheet is public! This can be seen on the online demo, where you can provide your own spreasdheet and the example will let you work on it!

Head to the asset page, and check the WebGL demo for yourself.

Did you know…? (Tip)

A leftover from the research required to circunvent cross-origin resource sharing or CORS (which was necessary for making the asset work on WebGL), is an undocumented feature: you can have server responses in JSONP.

If for some reason you need the server to answer in JSONP, all you need to do, is add a “callback” field to the POST form (with any content), and the server will return in the mentioned format :slight_smile:

Sorry if you’ve answered this before, can this asset serve as a data base in a multiplayer scenario or is will it only work for in house development needs (in other words, if I create a google drive folder and store image assets I want players to be able to access alongside a spreadsheet containing data, if this folder is made public, would players be able to play the game and access the data / images seamlessly?)? Secondly, will it only work with uploading or downloading .png and .jpg files? What about .pdf files?

Hey @DADA_universe ,

The asset can be used in production for sure. But of course it highly depends on the project and the scope. To put it in dumb terms, is not the ideal for an MMO :slight_smile: But if the game or app requirements can handle stateless requests (not persistent sessions), and doesnt need a lot of queries to the server, then you have a good case and a nice perk by having your own backend. If you start having congestion you can simply add a second instance of the web service accessing the same data, and make the game poke different urls.

Also, a good point in favour is that if at some point having the database and the service as this becomes unmanageable, the data is on spreadsheets, so portability is not an issue.

The folder doesn’t need to be public :wink:
The only reason to use public sharing is on the cases where you would want to access third party spreadhseets. On that case would need to be shared by the owner indeed, but if you’re talking of your own data, on the same Drive account, it does not need to be shared at all.

It depends on what you mean by seamlessly. You’ll be of course requesting data from a remote location, so there will be an expected time to retrieve it. Other than that, yes, players would be able to get the data.

The new API lets you upload and download any file type you want, text or binary, so PDF is covered.

Edit: the public api docs are available online here.

Thanks, hope it helps!

Thanks, that does seem reassuring. To be specific, I’m creating a virtual exhibition experience - just a first person camera / player navigating past and interacting with a set of exhibition screens. I have images, videos, audio files and pdfs to work with and I need a way to store and load these, in a way that the admin that run the project can curate the experience and change it from time to time, hence, Google drive was always a preferred option, but I was not sure if it was fine for production. This gives a bit more comfort and if it works, I would be building even more experiences on the back of this. Is there anything you think I should look out for when adopting the asset for this use case? For example, when you say ‘lots of queries to the server’, what would you say is the threshold in terms of traffic, beyond which the experience would degrade? That it supports WebGL builds is a plus, I already have a multiplayer set up using WebGL and a NodeJS server where data is being sent in JSON format, using Unity’s JsonUtility, which is also a plus seeing you have focused on Unity’s JsonUtility as well. I’m looking through the docs meanwhile and am just about ready to upgrade to GSFU.

Oh when I say lots of queries I mean Google Sheets For Unity works over http(s) protocol, is not a persistent stateful connection, so if your clients need constant communication, that would mean a lot of separated requests to handle, and on that case it would unlikely be a practical escenario to use the asset (this does not seem to be the case for your project).

I think the case you describe is good. The service should not degrade with user concurrency, but you may hit some Google webapps limits, on which case you can provide with further deployments of the webservice to improve the situation, just have that capability into account beforehand on your app.