# Trouble using hubDB tables in modules between dev and production

**URL:** <https://community.hubspot.com/t/trouble-using-hubdb-tables-in-modules-between-dev-and-production/85764>\
**Category:** CMS Development\
**Tags:** hubdb, local-development\
**Created:** [July 20, 2023, 1:37pm UTC](https://community.hubspot.com/t/trouble-using-hubdb-tables-in-modules-between-dev-and-production/85764 "2023-07-20T13:37:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![OBojahr](https://avatars.discourse-cdn.com/v4/letter/o/7c8e57/32.png) [@OBojahr](https://community.hubspot.com/u/OBojahr)\
**Post date:** [July 20, 2023, 1:37pm UTC](https://community.hubspot.com/t/trouble-using-hubdb-tables-in-modules-between-dev-and-production/85764/1 "2023-07-20T13:37:23Z")

</div>

We use the following:

```lia-code-sample
{% set hubDbPageId = 2617347 %}

{% set rwItem = hubdb_table_rows(hubDbPageId, 'hs_path='~countryFilter)|first %}

```

If I fetch that code from production and want to upload it to my test sandbox. I receive an error the table does not exist. I have the same table but with different ID in my sandbox.

How can I make my module portable, e.g. reference hubDB tables by name or so?

---

<div class="post-metadata">

**Author:** ![Anton](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/anton/32/103167_2.png) [@Anton](https://community.hubspot.com/u/Anton)\
**Post date:** [July 20, 2023, 5:16pm UTC](https://community.hubspot.com/t/trouble-using-hubdb-tables-in-modules-between-dev-and-production/85764/2 "2023-07-20T17:16:08Z")

</div>

Hi @OBojahr,

is it a (custom) module you’re using or is this implemented in some sort of template directly?

If custom module you could add a HubDB function to the module and write the code like this

```lia-code-sample
{% set hubDbPageId = module.hubdb_selector %}

{% set rwItem = hubdb_table_rows(hubDbPageId, 'hs_path='~countryFilter)|first %}

```

 ![Bildschirmfoto 2023-07-20 um 18.12.46.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/d/a/da0ad27a0022cb1d22241512800cd81020059e4e.png)

this will give you the ability to easily select the HubDB in the page builder (or design-tools)

if it’s implemented in a template there’s basically no solution since the HubDB ID can’t be changed and is a randomly generated number. You’ll need to change the number manually in the file

best,

Anton
