Build data-driven content with HubDB, HubSpot’s native database tool.
Column | Description |
---|---|
hs_id | An automatically assigned, globally unique, numeric ID for this row. |
hs_created_at | A timestamp of when this row was created. |
hs_path | When used with dynamic pages, this string is the last segment of the URL’s path for the page. |
hs_name | When used with dynamic pages, this is the title of the page. |
1
, but are not necessarily sequential, and cannot be reused. Column types include:
null
is equivalent to deleting the cell’s value.hubdb_table_rows
HubL function per CMS page.ID
column.
hubdb_table_rows()
to fetch data.
limit
in the function query. For example:hubdb_table_rows(12345, "orderBy=random()&limit=1500")
.<filterQuery>
uses the same syntax as the HTTP API. For example, hubdb_table_rows(123, "employees__gt=10&orderBy=count")
would return a list of rows where the “employees” column is greater than 10, ordered by the “count” column. A complete list of optional <filterQuery>
parameters can be found here.
Instead of using multiple row queries with different <filterQuery>
parameters, you should make one query and use the selectattr()
or rejectattr()
filters to filter your rows:
hubdb_table_row()
HubL function.
HS_ID
will work the same as hs_id
.
Attribute | Description |
---|---|
row.hs_id | The globally unique id for this row. |
row.hs_path | When using dynamic pages, this string is the Page Path column value and the last segment of the url’s path. |
row.hs_name | When using dynamic pages, this string is the Page Title column value for the row. |
row.hs_created_at | Unix timestamp for when the row was created. |
row.hs_child_table_id | When using dynamic pages, this is the ID of the other table that is populating data for the row. |
row.column_name | Get the value of the custom column by the name of the column. |
row["column name"] | Get the value of the custom column by the name of the column. |
hubdb_table()
function.
hubdb_table()
was assigned to in the above code. Your variable may differ. Note: It is recommended assigning this to a variable for easier use. If you don’t want to do that, you can use {{ hubdb_table(<tableId>).attribute }}
Attribute | Description |
---|---|
table_info.id | The id of the table. |
table_info.name | The name of the table. |
table_info.columns | List of column information. You can use a for loop to iterate through the information available in this attribute. |
table_info.created_at | Timestamp of when the table was first created. |
table_info.published_at | Timestamp of when this table was published. |
table_info.updated_at | Timestamp of when this table was last updated. |
table_info.row_count | Number of rows in the table. |
hubdb_table_column()
function
hubdb_table_column()
was assigned to in the above code. Your variable may differ. Note: It is recommended assigning this to a variable for easier use. If you don’t want to do that, you can use {{ hubdb_table_column(<tableId>,<columnId or column name>).attribute }}
Attribute | Description |
---|---|
table_info.id | The ID of the column. |
table_info.name | The name of the column. |
table_info.label | The label to be used for the column. |
table_info.type | Type of this column. |
table_info.options | For select column type, this is a map of optionId to option information. |
table_info.foreignIds | For foreignId column types, a list of foreignIds (with id and name properties). |
Method | Description |
---|---|
getOptionByName(" | For select column types, get option information by the options name. |
richtext
column type functions similar to the rich text field you see for modules.
The data is stored as HTML, and the HubDB UI provides a text editing interface. However, when editing a HubDB table through HubSpot’s UI, you cannot edit source code directly. This prevents situations where a non-technical user may input invalid HTML, preventing unintended issues with the appearance or functionality of your site. For situations where you need an embed code or more custom HTML you can use the embed feature in the rich text editor to place your custom code.