HubDB × Spreadsheet Sync

Automatically sync spreadsheet data to HubDB using Google Apps Script (GAS) and display dynamic content on HubSpot websites and blogs

HubSpotHubDBSpreadsheetGASData Sync
3 min read

What is HubDB?

HubDB is a relational database available within HubSpot CMS.

You can manage data in a spreadsheet-like table format and display it as dynamic content on HubSpot websites, blogs, and landing pages.

Table-based data management
DescriptionOrganize data in rows and columns, edit like a spreadsheet
API access
DescriptionRead and write data from external systems
HubL display
DescriptionDynamically retrieve and display data in templates and modules
Publish/Draft control
DescriptionManage draft and published states separately

Benefits of Spreadsheet Sync

Why connect spreadsheets to HubDB? Here are the key reasons.

Leverage Existing Workflows

Many organizations already manage various data in Google Sheets:

  • Product catalogs
  • Store listings
  • Ranking data
  • Campaign information

Manually copying this data to HubDB is time-consuming. With GAS automation, simply updating the spreadsheet automatically reflects changes on your website.

Easy Multi-user Editing

Spreadsheets excel at collaborative editing:

  • Sales teams update store information
  • Marketing teams add campaign details
  • Analytics teams compile ranking data

Each team updates the spreadsheet, and periodic sync keeps your website content current.

External Data Integration

Data from Google Analytics exports, POS sales data, and other external systems can be imported into HubDB via spreadsheets.

Overall Data Flow
External Data Sources

GA / POS / Core Systems

Google Sheets

Data aggregation & processing

GAS

Scheduled auto-sync

HubDB

Database in HubSpot

HubSpot Site / Blog / LP

Dynamic display with HubL modules

Basic Sync Flow

Syncing from spreadsheet to HubDB follows these 4 steps:

HubDB Sync Process
1. Unpublish

Set the currently published HubDB table to draft state

2. Delete Existing Data

Remove all draft rows from the table

3. Create New Data

Insert latest data from the spreadsheet

4. Publish

Republish the table to reflect changes on the site

Why This Flow?

HubDB has two states: "draft" and "published."

When updating data, you first unpublish to enter draft mode, replace the data, then republish. This prevents displaying incomplete data on your website during updates.

Prerequisites

To start HubDB sync, you need:

1. HubSpot Setup

  • CMS Hub Professional or higher plan
  • HubDB table created (with column definitions)
  • Private App created with access token

2. Google Setup

  • Source spreadsheet for syncing
  • Basic knowledge of Google Apps Script

3. Permission Requirements

The HubSpot Private App needs these scopes:

cms.hubdb.tables.read
PurposeRead table information
cms.hubdb.tables.write
PurposePublish/unpublish operations
cms.hubdb.rows.read
PurposeRead row data
cms.hubdb.rows.write
PurposeCreate/delete rows

Next Steps

To implement this system, see the following articles:

  • GAS Data Transmission: Implementing sync code with APIs
  • HubL Module Display: Creating modules to display HubDB data
  • Use Cases: Practical examples like rankings and store listings

Summary

HubDB × Spreadsheet sync enables:

  • Workflow efficiency: Leverage existing spreadsheet operations
  • Real-time updates: Scheduled sync keeps information current
  • Flexible data use: Reflect external system data on your website
  • Distributed operations: Each team updates data their preferred way

Consider this approach when you want to use spreadsheet-managed data on your HubSpot website.

Related Topics