A collection of methods related to the HubDB Tables API
Methods
-
Add row to a HubDB table
Name Type Description tableIdint optionsobject Returns:
Type Description Promise Example
const hs = new HubSpotClient(props); hs.hubdb.addTableRow(tableId, options).then(response => console.log(response)) -
Create a new HubDB table
Name Type Description optsobject Properties:
Name Type Description opts.namestring opts.useForPagesboolean opts.columnsarray opts.publishedAtint Returns:
Type Description Promise Example
const hs = new HubSpotClient(props); hs.hubdb.createTable(opts).then(response => console.log(response)); -
Delete row from a HubDB table
Name Type Description tableIdint rowIdint optionsobject Returns:
Type Description Promise Example
const hs = new HubSpotClient(props); hs.hubdb.deleteTableRow(tableId, rowId, options).then(response => console.log(response)) -
Retrieve HubDB table by ID
Name Type Description tableIdint portalIdint optionsobject Returns:
Type Description Promise Example
const hs = new HubSpotClient(props); hs.hubdb.getTableById(tableId, portalId, options).then(response => console.log(response)) -
Get rows in a HubDB table
Name Type Description tableIdint portalIdint optionsobject Returns:
Type Description Promise Example
const hs = new HubSpotClient(props); hs.hubdb.getTableRows(tableId, portalId, options).then(response => console.log(response)) -
Get a collection of HubDB tables
Returns:
Type Description Promise Example
const hs = new HubSpotClient(props); hs.hubdb.getTables(opts).then(response => console.log(response)); -
Publish a draft table
Name Type Description tableIdint Returns:
Type Description Promise Example
const hs = new HubSpotClient(props); hs.hubdb.publishTable(tableId).then(response => console.log(response)) -
Batch update in a HubDB table
Name Type Description tableIdint optionsobject rowsarray The rows to update
Returns:
Type Description Promise Example
const hs = new HubSpotClient(props); const options = { rows: [ { id: 1234567, createdAt: 1000000000, path: 'test', name: 'Test', values: { '2': 'Some data', '3': 'None', } }, ...more rows ]} hs.hubdb.updateTableRows(tableId, options).then(response => console.log(response)) -
Update row in a HubDB table
Name Type Description tableIdint rowIdint optionsobject Returns:
Type Description Promise Example
const hs = new HubSpotClient(props); hs.hubdb.updateTableRow(tableId, rowId, options).then(response => console.log(response))