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.
| Feature | Description |
|---|---|
| Table-based data management | Organize data in rows and columns, edit like a spreadsheet |
| API access | Read and write data from external systems |
| HubL display | Dynamically retrieve and display data in templates and modules |
| Publish/Draft control | Manage 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.
GA / POS / Core Systems
Data aggregation & processing
Scheduled auto-sync
Database in HubSpot
Dynamic display with HubL modules
Basic Sync Flow
Syncing from spreadsheet to HubDB follows these 4 steps:
Set the currently published HubDB table to draft state
Remove all draft rows from the table
Insert latest data from the spreadsheet
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:
| Scope | Purpose |
|---|---|
| cms.hubdb.tables.read | Read table information |
| cms.hubdb.tables.write | Publish/unpublish operations |
| cms.hubdb.rows.read | Read row data |
| cms.hubdb.rows.write | Create/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.