# Access the data for a foreign column in HubDB

**URL:** <https://community.hubspot.com/t/access-the-data-for-a-foreign-column-in-hubdb/83243>\
**Category:** CMS Development\
**Tags:** hubdb\
**Created:** [June 13, 2023, 11:11am UTC](https://community.hubspot.com/t/access-the-data-for-a-foreign-column-in-hubdb/83243 "2023-06-13T11:11:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alvarofranz](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/alvarofranz/32/63428_2.png) [@alvarofranz](https://community.hubspot.com/u/alvarofranz)\
**Post date:** [June 13, 2023, 11:11am UTC](https://community.hubspot.com/t/access-the-data-for-a-foreign-column-in-hubdb/83243/1 "2023-06-13T11:11:02Z")

</div>

I have a HubDB table with a foreign column.

I want to access the data for one of the values in the foreign column.

Doing {{ dynamic\_page\_hubdb\_row.listing\_agent|pprint }} prints:  
_(SizeLimitingPyList: [{id=111111111, createdAt=1686312011111, updatedAt=168665311111, 1=‘{type=string, value=Value}’, 2=‘{type=string, value=+1.11.977.111}’, 3=‘{type=string, [value=test@test.com](mailto:value=test@test.com)}’, 4=‘{type=string, value=DRE1234}’, 5='{type=image, value=Image{width=283,height=500,url='[https://1111.hubspotusercontent-na1.net/hubfs/111/test.webp’,altText=‘’}}'](https://1111.hubspotusercontent-na1.net/hubfs/111/test.webp',altText=''%7D%7D')}])_  
But how do I access the column “5” (in the foreign table, this column is called photo). The options I tried do not work. I tried these and they all print “null”:

- {{ dynamic\_page\_hubdb\_row.listing\_agent.5|pprint }}
- {{ dynamic\_page\_hubdb\_row.listing\_agent[5]|pprint }}
- {{ dynamic\_page\_hubdb\_row.listing\_agent[‘5’]|pprint }}
- {{ dynamic\_page\_hubdb\_row.listing\_agent.photo|pprint }}

---

<div class="post-metadata">

**Author:** ![alyssamwilie](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/alyssamwilie/32/2072_2.png) [@alyssamwilie](https://community.hubspot.com/u/alyssamwilie)\
**Post date:** [June 13, 2023, 12:06pm UTC](https://community.hubspot.com/t/access-the-data-for-a-foreign-column-in-hubdb/83243/2 "2023-06-13T12:06:43Z")

</div>

The Foreign ID column type is a multiselect so you have to actually loop through the values to get the available content.

```lia-code-sample
{% for agent in dynamic_page_hubdb_row.listing_agent %}
 {{ agent.photo.url }}
{% endfor %}

```

---

<div class="post-metadata">

**Author:** ![alvarofranz](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/alvarofranz/32/63428_2.png) [@alvarofranz](https://community.hubspot.com/u/alvarofranz)\
**Post date:** [June 13, 2023, 12:44pm UTC](https://community.hubspot.com/t/access-the-data-for-a-foreign-column-in-hubdb/83243/3 "2023-06-13T12:44:05Z")

</div>

Oh, cool beans. I guess there is no way to limit it to allow users only select one item. In any case, thanks for helping out with this! 🙂
