APIs & Integrations

stephentradify
Participant

HubDB foreign ID column

Résolue

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 Votes
1 Solution acceptée
mcoley
Solution
Équipe de développement de HubSpot
Équipe de développement de HubSpot

HubDB foreign ID column

Résolue

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

Voir la solution dans l'envoi d'origine

6 Réponses
mcoley
Solution
Équipe de développement de HubSpot
Équipe de développement de HubSpot

HubDB foreign ID column

Résolue

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

mcoley
Équipe de développement de HubSpot
Équipe de développement de HubSpot

HubDB foreign ID column

Résolue

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

0 Votes
LPM
Contributeur de premier rang | Partenaire solutions Diamond
Contributeur de premier rang | Partenaire solutions Diamond

HubDB foreign ID column

Résolue

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 Votes
zwolfson
HubSpot Employee
HubSpot Employee

HubDB foreign ID column

Résolue

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
Contributeur | Partenaire solutions Elite
Contributeur | Partenaire solutions Elite

HubDB foreign ID column

Résolue

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 Votes
zwolfson
HubSpot Employee
HubSpot Employee

HubDB foreign ID column

Résolue

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 Votes