Skip to main content

Google Sheets

Google Sheets is a web-based spreadsheet application offered as part of the Google Docs Editors suite. Sheets allows you to create and edit spreadsheets, leverage numerous formulas and functions to process data, and even write custom code. You can also collaborate with multiple users in real time.

Sheets is a popular integration with Tonkean not only because it provides a convenient place to store and manipulate data as it moves through a Tonkean workflow, but also because your team is likely already working there.

Authenticate with Sheets

To use Sheets in Tonkean, you must first connect it as a data source:

  1. Select the main nav icon, grid.png, in the upper left and select Enterprise Components. The Enterprise Components screen displays.

  2. Select + New Data Source in the upper right.

    connect_data_sources_add_data_source.png
  3. Select Spreadsheets / Files. The Add New Data Source window displays.

    add_spreadsheet_files_data_source.png
  4. Select Google Sheets. The New Google Sheets Connection window displays.

    add_new_data_source_add_sheets.png
  5. Select Create a new connection. The Setup Google Spreadsheet window displays.

    new_sheets_connection_create_new.png
  6. You have two options for authenticating with Google Sheets:

    • OAuth - Log in with your Google account username and password:

      1. Select OAuth and then select Authenticate with Google Sheets. A Sign In window displays

      2. Select the Google account you want to connect to Tonkean. You are informed that Tonkean is requesting access to your Google account. Select Allow.

    • Service Account - Provide the credentials for your service account in JSON format.

    Once the you connect the data source, you cannot change the authentication type. We recommend consulting with your organization's IT department to ensure you're following account and security best practices.

  7. After authenticating with Google Sheets, the Setup Google Spreadsheet window displays the Select a Spreadsheet field. Select the spreadsheet you want to connect to Tonkean. The selected spreadsheet serves as the data source, the rows and columns from which Tonkean will monitor and update with relevant actions.

    The selected spreadsheet cannot be changed in the future. You must set up another Google Sheets connection to access a separate spreadsheet.

    select_a_spreadsheet.png

    Once you select a spreadsheet to connect, several sections display where you configure the data structure, map fields, and define the usage method.

Configure Spreadsheet Mapping and Permissions

Once your chosen spreadsheet is connected, you must configure how the spreadsheet's rows and columns are mapped to Tonkean, as well as what permissions Tonkean has.

Set Data Structure

When you connect a spreadsheet as a data source, you can select one worksheet. You must also specify the header row and on which row the data starts. In the example below, the header is on row 1 and the data starts on row 2.

header_and_first_rows.png
  • Select worksheet - Select the worksheet for Tonkean to access.

    The selected worksheet cannot be changed in the future.

  • Header row - Specify which row on the worksheet is the header row. The columns in the header row are used as metadata for the fields.

  • Start from row - Specify which row the content starts on (that is, the first row that is not the header).

set_data_structure.png

Map Columns to Item Fields

In this section, you map the columns from your spreadsheet to Tonkean. Unlike other data sources, Sheets does not by default assign unique IDs to the data, so you must specify one of the columns to act as the unique ID, allowing Tonkean to distinguish between the rows (items).

These columns are used as the Title and Unique Identifier for each item. Keep in mind as you map these columns that you may encounter different use cases for the spreadsheet in the future, so configure the rows in a way that allows flexibility in the future.

An item in Tonkean corresponds with a row in the spreadsheet.

  • Item display name - The name that displays for the item; this is the data source item Title. In the example Employee List spreadsheet, column B, "Full Name", is an acceptable value.

  • Unique Identifier - The unique identifier for the item. This value must always be unique to the item and cannot change. For example, looking at the example Employee List spreadsheet, you cannot choose "Full Name" or "Address" since there's no guarantee there won't be another employee with an identical name or address. "Email" is generally an acceptable choice as a unique identifier, but the safest choice is "Employee ID", which will not change at any point in the future and can not be duplicated.

Duplicated rows are not allowed. The data collection process aborts if a row with the same ID already exists.

map_columns_to_item_fields.png

Spreadsheet Usage Method

Tonkean supports two usage methods for Sheets:

  1. Add / Update / Delete - This usage method allows the basic Create, Remove, Update, Delete (CRUD) operations and supports spreadsheets up to 100,000 rows. With this method, you can add new rows, update existing rows, and delete rows.

    We recommend this method for spreadsheets containing data that is updated frequently and doesn't contain (now or in the future) 100,000 or more rows.

  2. Append - This usage method allows only the appending (adding) of new rows and supports spreadsheets up to 500,000 rows. This method does not allow you to update or delete existing rows.

    We recommend this method for spreadsheets containing record or log data (for example, an audit trail), or for large data sets that are not updated.

The usage method cannot be changed in the future.

Monitor Google Sheets as an Input Source

Like most data sources, you can use Google Sheets as the module input source:

  1. After creating a new module, select the input source tile. The Configure Input Source panel displays.

  2. Select the relevant Google Sheets spreadsheet from the available data sources.

    data_source_g_sheets.png
  3. Select the spreadsheet items dropdown and select the entity to monitor. Currently, this field defaults to Rows.

    config_input_source_items.png
  4. Select whether to monitor all entities of the selected type or to create a custom filter to monitor only specific entities. Then, if you select to create a custom filter, configure the conditions for the filter.

    config_g_sheets_input_source_custom_filter.png

    When setting up a new input source, we recommend always adding a custom filter instead of monitoring all entities of the selected type. This ensures there's a smaller amount of data to monitor and respond to. For example, configuring the filter to monitor Rows that contain a value in a specified field is a good place to start.

  5. When finished, select Preview Items & Save.

Your module is monitoring the specified Google Sheets spreadsheet.

Additional Configuration

Troubleshoot Common Issues

There are some common issues you may encounter with a Sheets integration. You can usually address these issues by knowing what the practical limitations are in Sheets and understanding how Sheets and Tonkean interact.

Slow Data Collection

While the Tonkean platform is designed to seamlessly exchange data between people and systems, and target an almost instantaneous workflow experience, Sheets is not designed with the same expectations. For example, it is not optimized to handle large amounts of data. For this reason, data collection for spreadsheets containing very large row counts (for example, nearing 100,000 rows) can take time to process. It is not uncommon to see data collection take up to 10 minutes.

If you're encountering issues from this long processing time and there's not an option to reduce the number of rows in a spreadsheet, we recommend accounting for this processing time in your workflow, such as including a Wait trigger.

More Columns than Expected

Tonkean collects all the columns in a connected spreadsheet, whether those columns contain data or not. Because Sheets by default includes 26 columns (lettered A-Z), you'll likely find Tonkean collects many empty columns. This is expected behavior.

Deleted Columns Still in Tonkean

If you delete columns from a connected spreadsheet, the corresponding columns are not deleted in Tonkean. Instead, data is cleared from deleted columns. You may see the fields that were contained within a deleted column include the text "[OUTDATED]" when the data is no longer available.

deleted_column_outdated.png

Unexpected Behavior After Moving Columns

Spreadsheet columns are dynamic and may often be renamed, moved, or otherwise changed. However, modifying columns after connecting a spreadsheet can cause unwanted behavior like duplicated columns or, in the worst cases, failures to collect.

We recommend not modifying columns after you have connected the spreadsheet. Similarly, we recommend not cutting and pasting to override column values. Instead, consider copying only the data and renaming the column.

Problems with Empty Rows in the Middle of the Spreadsheet

Empty rows in the middle of a spreadsheet can cause substantial errors in your Sheets integration. When appending a new row, the Google Sheets API fills in empty rows first before adding new rows below existing rows.

For example, if you have 50 rows and row 20 is empty, the Google Sheets API will append a new row on row 20 instead of adding it on row 51, regardless of how much space is available. This insertion shifts all existing rows down and renders the data source unusable.

Because of this behavior, we recommend not leaving any empty rows in your spreadsheet when using the append method.