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

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?

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?

Hey @WendyGoh

Let’s say I have the following HubDB Tables:


Table 1


Table 2


Table 3

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

26892i2CCF40B89649507D.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.

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.