A collection of methods related to the HubDB Tables API
Methods
-
Add row to a HubDB table
Name Type Description tableId
int options
object 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 opts
object Properties:
Name Type Description opts.name
string opts.useForPages
boolean opts.columns
array opts.publishedAt
int 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 tableId
int rowId
int options
object 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 tableId
int portalId
int options
object 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 tableId
int portalId
int options
object 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 tableId
int 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 tableId
int options
object rows
array 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 tableId
int rowId
int options
object Returns:
Type Description Promise Example
const hs = new HubSpotClient(props); hs.hubdb.updateTableRow(tableId, rowId, options).then(response => console.log(response))