APIs & Integrations

razvanrus
Participant

Get HubDB Row by id / use Foreign Keys via HubDB API

SOLVE

Hello,

I have a table made using js and I want to populate it with data from a HubDB table, but 2 values are foreign keys, and I need to take those values from other tables. 

What I tried so far was to add "id__in=id1,id2,id3" in the query for the second table but didn't work.

 

Is there another way to do that?

Or do I need to use some custom id field?

 

0 Upvotes
1 Accepted solution
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

Get HubDB Row by id / use Foreign Keys via HubDB API

SOLVE

Hey @razvanrus,

 

I believe this documentation: The Best Method for Loading Multiple HubDB Tables At The Same Time can help to shed some lights on how to display data from multiple tables without loading all the rows. 

View solution in original post

0 Upvotes
3 Replies 3
WendyGoh
HubSpot Employee
HubSpot Employee

Get HubDB Row by id / use Foreign Keys via HubDB API

SOLVE

Hey @razvanrus,

 

Just to clarify, do you mean that there's 2 foreign keys in the HubDB table and you'd like to retrieve that to populate it on a table you made using JS?

0 Upvotes
razvanrus
Participant

Get HubDB Row by id / use Foreign Keys via HubDB API

SOLVE

Hey @WendyGoh

Let's say I have the following HubDB Tables:

 

Table 1Table 1

 

 

Table 2Table 2

 

Table 3Table 3

 

And I the table on my webpage to look like this:

image.png

Without downloading all the rows from all 3 tables and then searching the rows I need between them.

 

Also indeed, I use javascript in order to update my HTML table and make the ajax calls.

 

0 Upvotes
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

Get HubDB Row by id / use Foreign Keys via HubDB API

SOLVE

Hey @razvanrus,

 

I believe this documentation: The Best Method for Loading Multiple HubDB Tables At The Same Time can help to shed some lights on how to display data from multiple tables without loading all the rows. 

0 Upvotes