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, this asset is the result 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 above!

Just set the 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:

✔ Read & Write to spreadhseets.
✔ Upload & Download files: binary, text, images.
✔ Works with desktop, mobile and WebGL.
✔ Source code included.
✔ No Google account credentials required on the Unity side.
✔ Works with private and public Google spreadsheets.
✔ 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.

Check the screenshots!

How it works?

The Unity side API enables working with spreadsheets as object tables (each row is an object), 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 Google Drive developers 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 is available with the asset in PDF format.

Compatibility: Tested with Unity 2018.3 onwards.

Package Contents Peak


Important Disclaimmer!

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

Lite version

The original version has been rebranded "Lite" edition, to denote the difference with this new asset. It can be found at the Unity Asset Store.

The new version, available on this page, 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.

Useful Links

Unity Forum thread
Client API Reference
Facebook
Twitter

Check more tools

Cloud Console For Unity

Purchase

Buy Now$23.00 USD or more

In order to download this tool you must purchase it at or above the minimum price of $23 USD. You will get access to the following files:

GoogleSheetsForUnity.unitypackage 694 kB

Development log

Comments

Log in with itch.io to leave a comment.

I get the following error when trying the demo above: 

An error occurred running the Unity content on this page. See your browser JavaScript console for more info. The error was:
TypeError: null is not an object (evaluating 'document.getElementById("canvas").style')

Then, attempting to "Create Character Table/Worksheet", it says:

Connection error after 1.3 seconds: Unknown Error

(2 edits)

Hey. You can disregard the javascript error, is a dom issue on the code used to type or paste the spreadsheet id.

Regarding the second issue, I just checked and is working as expected, please double check your spreadsheet id, and follow the instructions (described on the demo itself).

Remember that the spreadsheet needs public permissions (only required for the public demo).

(+1)

Figured it out - I had made it public, but the default is read-only, and I didn't notice!

Suddenly I'm getting connection errors with my sheet; also with the example here. What could be the reason?

(-1)

Hey there, checking it. In the meantime, would you elaborate on what errors are you getting? Thanks!

Im not getting errors here on the demo on this page. Can you describe more whats happening for you?

(1 edit) (+1)

Hey! Sorry, it was kind of a false alarm. Seems like I had to re-authenticate for the script again, even though I didn't change anything. The error at the demo was me being an idiot.

(+1)

Thank you for letting me know, cheers!

Ieps! great tool.

I have two questions though. How do you properly import data with columns that have a formula like this '={OtherSheet!A:A}' ? right now importing that data causes to import all the spreadsheet rows, I can filter the ones that are valid but maybe there is a better solution. The second question is related on how to securely handle the password in the connection file that is only needed in the editor (not store it in the repository), do you have any recommended solution to that? right now I'm just using a file ignored in in git that contains the password.

Regards!

Hello @Swing Wren. Sorry about the delay coming back to you. The dayjob has been very pressing and the time for GSFU support has been tight.

Im not sure I understand correctly the case. What you mean "importing that data causes to import all the spreadsheet rows"?

Regarding the password, your approach seems fine, however it may be limiting if the project uses any sort of CI/CD, so if you use for example Unity Cloud Build, you'll need to include the pass in the repo. Otherwise is good, just make sure that the file is included in the build.  I dont have any particular recomendations, as usually the people involved in the project needs access to the service, and is unlikely to result feasible for the devs to not count with the pass.

Thanks for the reply!. What i mean is that using

ConfigRaw configRaw = JsonHelper.ArrayFromJson<ConfigRaw>

 With '={OtherSheet!A:A}'  it causes configRaw to have 999 elements (all rows).

Thanks for the clarification. I'll have to try that! Have not seen behaviours like that before, but neither used that forumla, so I'll try and get back to you.

So what are the exact differences between the Lite version and this one?
And how can I buy this version through the Asset Store?
My company has a debit card connected with the Asset Store and when I need to buy something outside of it, it gets complicated :)

(2 edits)

Hello Mat, thanks for contacting.

The Lite version focus is on Google Spreadsheets, while the main version has some extended capabilities to handle Google Drive files and images. Also there is a proof of concept custom session handling system.

Im afraid the main version of the asset is not on the Unity Asset Store. Let me know if I can help in any other way :)

I have a couple scene, after I used

        foreach (GameObject o in Object.FindObjectsOfType<GameObject>())
        {
            Destroy(o);
        }

then, I reload the scene.

MissingReferenceException: The object of type 'DriveConnection' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.

turn out is the follow code

StartCoroutine(CoExecuteRequest(www, postData));


How can I properly stop the connect and start over?

(1 edit)

I really dont understand exacctly what you mean, or what you need. The code is all in the asset so you can do whatever you need.

The handling of scene transitions varies hugely from project to project, so I cant provide a reasonable solution that would cover every case. In that regard, making the connections handling working correctly according to your own approach, is entirely up to you.

(3 edits) (+1)

I got the same problem as the OP. The problem is that "driveConnectorRuntime" gets lost with a level reload, but "_connectionData" does not (pesky static variables! ;), so driveConnectorRuntime will be null if you use e.g. Drive.GetAllTables() on Start() again, and that throws an error. Can you please make an update so it checks if driveConnectorRuntime is null or not?

(My hack right now is to make _connectionData public and setting it to null by hand in an OnDestroy().)

(+1)

Hey there, thanks for the elaboration!

I will annotate this for the next update update indeed, and although I have not ETA atm, I definitively have a list of things to work on. 

Cheers!

I would love to buy this asset, but it is not working for me.

I tried with different sheet ids and it doesn't work.

Do you happen to have an example sheet id?

Hey there. I just tested and is working as expected. You can double check that you are pasting a valid spreadsheet id, and that the spreadsheet has public permissions (only needed for this public demo).

Hi Novack

Now I got one step further:
1.I had to create my public  sheet and copy out the ID
2.Paste the ID and only then I could push the button "Create Table/Worksheet"
3.Then it created a new tab and from this tab I could then read and write.

So it seems to work this way, but had to find out the order of actions myself. Maybe a video would help how to use this stuff the first time.  Anyway I will buy it and try to use it.

Zsolt

The order of actions is the natural. How could it work with a spreadhseet without knowing which one?

But more importantly, its explicitly expained in the demo itself, just above the input where you paste the spreadsheet id.

Why i can't see the sheets on GDrive? I can create and edit tables but I can't find them.

Hello. I dont understand your question, can you elaborate? You can also contact me by email.

Hi, where i can find your email?

In the developer guide PDF you will find the support email, along other useful data ;)

(+2)

Thanks for the great plugin. How to track Drive upload/download progress?  I can't find any www.uploadProgress or www.uploadedBytes handlers

(1 edit)

There is none at the moment! I will add upload progress tracking on next update, thanks a lot for bringing this up.

Download progress handling can be more trickier given that Google uses chunked encoding on responses, and thus, there is no Content-Length header which is required by Unity API to monitor progress.

I will work on it for the next update, which will be after finishing my current project, a simple but effective chat extension for Unity.

(+1)

Thanks for letting us know. Will also keep an eye out for your chat extension - perfect for my next project!

(+1)

+1.

Especially for download progress.

(+1)

Will there be updates when buying from this site?

(2 edits)

Hello there, thanks for contacting.

Absolutely! I will be posting updates and patch releases here as they are developed. Also will do my best to announce them!