APIs & Integrations

stephentradify
Participant

HubDB foreign ID column

SOLVE

I noticed a new column type called "Foreign ID" in HubDB. I'm guessing its for accessing rows of other tables but I tried using it in a template and it didn't work. Also I can't find anything about it in documentation. How do you use it?

0 Upvotes
1 Accepted solution
mcoley
Solution
HubSpot Product Team
HubSpot Product Team

HubDB foreign ID column

SOLVE

The underlying issue was a bug that made these Foreign ID columns case-sensitive. This should be fixed by this afternoon.

View solution in original post

6 Replies 6
mcoley
Solution
HubSpot Product Team
HubSpot Product Team

HubDB foreign ID column

SOLVE

The underlying issue was a bug that made these Foreign ID columns case-sensitive. This should be fixed by this afternoon.

mcoley
HubSpot Product Team
HubSpot Product Team

HubDB foreign ID column

SOLVE

@dannio Can you DM a link to the table? I cannot reproduce this on my end.

0 Upvotes
LPM
Top Contributor | Diamond Partner
Top Contributor | Diamond Partner

HubDB foreign ID column

SOLVE

I'm also having an issue with this feature.

When I access my table, this is the row data:

{% for row in hubdb_table_rows(*******) %}
    {{ row }}
    the name for row {{ row.hs_id }} is {{ row.name }}
    {% for speaker in row.speaker %}
    the name for foreign row {{ speaker.hs_id }}
    {% endfor %}
    <br>
{% endfor %}

I tried dumping the row data and I got this:
{id=*******, createdAt=1541496386035, 1='{type=string, value=Stuff}', 2='{type=string, value=11:00}', 3='{type=string, value=He}', 4='{type=option, value={id=1, name='standard'}}', 5='{type=option, value={id=2, name='fifteen-minutes'}}', 6='{type=list, value=[com.hubspot.hubdb.model.types.ForeignId@517bffca]}', 7='{type=option, value={id=1, name='1'}}', 8='{type=list, value=[{id=1, name='09:00'}, {id=3, name='10:00'}]}'}

As you can see, in position 6, there's "com.hubspot.hubdb.model.types.ForeignId@517bffca"

When I try to access the data, it's coming back blank for me. {{ speaker.hs_id }} returns nothing.

Am I doing something wrong?

0 Upvotes
zwolfson
HubSpot Employee
HubSpot Employee

HubDB foreign ID column

SOLVE

Hey @stephen_c,

You are very observant, that just came out. Here is our documentation on it https://designers.hubspot.com/tutorials/how-to-join-hubdb-tables. If you have any further questions, let me know.

-Zack

BenSBM
Contributor | Elite Partner
Contributor | Elite Partner

HubDB foreign ID column

SOLVE

Hey Zach,

I'm getting a console error: "Error:Syntax error in "[missing {{token}} value]"

I can't see why. The if statement for the foreign ID column is fine, outputting {{ row }} shows the data, but I keep getting an error on the inner for-loop. Am I missing something?

0 Upvotes
zwolfson
HubSpot Employee
HubSpot Employee

HubDB foreign ID column

SOLVE

Hi @ben_sbm,

I don't see anything immediately wrong with that. Would you mind direct messaging me (if you click on my name you should be to start a DM) a link to the template/module where you are working on this so I could take a closer look?

-Zack

0 Upvotes