Configuring a new Table

Setting up / Modifying Google Sheets & prepping for import

These instructions are for if you are adding (or MODIFYING) a Google Sheets Table and want to configure pulling it down into Unity. These steps must be done ONCE per Sheet in Google Sheets to tell Unity the data types that are being loaded.

In order to pull the data from Google Sheets into Unity, we first need to configure the database with the fields, field types and structure.

Note: This process needs to be done any time you change the structure of a sheet in Google Sheets.

On the Data Source tab (from above), select the Data structure extraction wizard button.

  • Open BG database (Window -> BG Database)

  • Export / Import tab

  • Data Sources tab

  • Select your Data Source from the list

The Data Structure Extraction Wizard is a multi-step wizard that lets us pick which sheets we want to access and configure how we want the data to be parsed into Unity.

This step needs to be run at least ONCE per sheet that we add, and also if we have changed the structure of our tables at all

NOT the data, but if we add a new column for example

Step 1: Select Google Sheets

First, select the ‘Google Sheets v4 API’ tab

Click ‘Read Data >>’ which will scan the google sheet and look for any tables that might exist.

Step 2: Configure which Sheets we are loading

The wizard will show you a list of all of the tables in the google sheet.

Ignoring a Sheet:

If you have incomplete tables, or tables that you do NOT want to import (for example a scratch pad that you are using to visualize data etc), simply click the ‘Ignored’ checkbox. BG Database will not import / process that sheet going forward.

Configuring Field types

Next, we need to tell BG Database what data type we want to use for each of the fields.

If you skip this step, BG database will do it’s best to try and figure out the type, but is likely to get it wrong

Click the ‘View Fields’ button for each table to configure the field types

This will show you a list of all of the columns in your sheet, like so, as well as the predetermined ‘guess’ that BG Database made for the individual columns.

If you click where it says ‘int’ under Type, you can see a list of all of the data types that BG Database supports (there are a lot of them).

And if you click the ‘Show all Fields >>>’ entry, it will open the full list.

If you want to configure another table, click ‘back to summary’ in the upper left, to go back to the table list (NOT the ‘back’ button, which will basically exit the wizard and you’ll have to start from scratch (a little annoying and something I always screw up).

Back at the summary list, there is another way to configure the field types ‘all in one’.

If you click the ‘Flattened View’ checkbox, the wizard will show you the field details all in a single list, like so:

For a smaller sheet like I have for this demo currently, this works well, however if you have dozens of sheets each with dozens of fields, this becomes a little unwieldy, which is why I prefer to manage each sheet separately using the 2 step flow I have described above.

Step 3: Import the new Data structure!

Simply click the ‘Step 2 / 3 Import >>’ button at the bottom of the wizard, and BG Database will setup the new data structure!

Note That this does NOT import the ‘actual’ data yet. It simply sets up BG Database with the proper data structure. Follow the Steps under ‘Importing Data from Google Sheets’ to actually import and view the data in Unity.

And BG Database prompts you to ‘save’ your changes again!

Last updated