# hubdb\_table\_rows() tableIdの代わりにテーブル名でデータを取得する方法

**URL:** <https://community.hubspot.com/t/hubdb-table-rows-tableid/127616>\
**Category:** Tips, Tricks & Best Practices\
**Tags:** hubdb\
**Created:** [March 10, 2025, 6:29am UTC](https://community.hubspot.com/t/hubdb-table-rows-tableid/127616 "2025-03-10T06:29:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![YKAKO](https://avatars.discourse-cdn.com/v4/letter/y/d07c76/32.png) [@YKAKO](https://community.hubspot.com/u/YKAKO)\
**Post date:** [March 10, 2025, 6:29am UTC](https://community.hubspot.com/t/hubdb-table-rows-tableid/127616/1 "2025-03-10T06:29:45Z")

</div>

HubDBでデータを取得する際、tableIdの代わりにテーブル名でデータを取得する方法を探しています。

[HubDBの開発ページ](https://developers.hubspot.jp/docs/guides/cms/storage/hubdb/overview#%E8%A1%8C%E3%81%AE%E5%8F%96%E5%BE%97)では、以下のように「_\<tableId or name\>_」という記述があったので、ID（数字）ではなく、HubDBのテーブル名（各HubDBテーブル作成時に設定する固有名）でも代用可能だと思ったのですが、テーブル名ではデータが拾えずにいます。

_{% for row in hubdb\_table\_rows(\<tableId or name\>, \<filterQuery\>) %}_  
_the value for row {{ row.hs\_id }} is {{ row.\<column name\> }}_  
_{% endfor %}_

何か補足やアイディアがあればお願いします！

---

<div class="post-metadata">

**Author:** ![marykashima](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/marykashima/32/13515_2.png) [@marykashima](https://community.hubspot.com/u/marykashima)\
**Post date:** [March 10, 2025, 7:13am UTC](https://community.hubspot.com/t/hubdb-table-rows-tableid/127616/2 "2025-03-10T07:13:08Z")

</div>

_@YKAKO こんにちは、  
tablenameの場合、""で記載する必要ありです。__tableIdは""は不要です。  
こちらでお試しいただけますか。_

_{% for row in hubdb\_table\_rows( “hoge”, \<filterQuery\>) %}  
the value for row {{ row.hs\_id }} is {{ row.\<column name\> }}  
{% endfor %}_

---

<div class="post-metadata">

**Author:** ![YKAKO](https://avatars.discourse-cdn.com/v4/letter/y/d07c76/32.png) [@YKAKO](https://community.hubspot.com/u/YKAKO)\
**Post date:** [March 10, 2025, 7:45am UTC](https://community.hubspot.com/t/hubdb-table-rows-tableid/127616/3 "2025-03-10T07:45:24Z")

</div>

@marykashima さん、早々にありがとうございます！

無事に出来ました！🙌

ありがとうございました！！！
