# Hubdb column data not showing using api call

**URL:** <https://community.hubspot.com/t/hubdb-column-data-not-showing-using-api-call/102756>\
**Category:** CMS Development\
**Tags:** hubdb\
**Created:** [March 16, 2024, 5:27pm UTC](https://community.hubspot.com/t/hubdb-column-data-not-showing-using-api-call/102756 "2024-03-16T17:27:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MBravo0](https://avatars.discourse-cdn.com/v4/letter/m/8dc957/32.png) [@MBravo0](https://community.hubspot.com/u/MBravo0)\
**Post date:** [March 16, 2024, 5:27pm UTC](https://community.hubspot.com/t/hubdb-column-data-not-showing-using-api-call/102756/1 "2024-03-16T17:27:24Z")

</div>

Hi, not a developer per se in here 😬 The code im using was generated in chatgpt.

I am trying to retrieve data colum values from a hubdb table and public api calls. This is my code, i am not using authentication because i have the public api option in the table.

\<h1\>Contenido de la Tabla de HubDB\</h1\>  
\<table id=“tableData” style=“border-width: 1px; border-style: solid;”\>  
\<tbody\>  
\<tr\>  
\<th style=“border-width: 1px; border-style: solid;”\>ID\</th\>  
\<th style=“border-width: 1px; border-style: solid;”\>Nombre del Producto\</th\>  
\<th style=“border-width: 1px; border-style: solid;”\>Precio del Producto\</th\>  
\</tr\>  
\</tbody\>  
\</table\>  
\<script\>  
// Portal ID y ID de la tabla en HubDB  
var portalId = ####;  
var tableId = #####;

// URL de la API de HubDB para obtener los datos de la tabla  
var url = `[https://api.hubspot.com/cms/v3/hubdb/tables/${tableId}/rows?portalId=${portalId}\`](https://api.hubspot.com/cms/v3/hubdb/tables/$%7BtableId%7D/rows?portalId=$%7BportalId%7D%5C%60);

// Realizar una solicitud GET a la API de HubDB utilizando AJAX  
var xhr = new XMLHttpRequest();  
xhr.open(“GET”, url, true);  
xhr.onreadystatechange = function () {  
if (xhr.readyState === 4 && xhr.status === 200) {  
var data = JSON.parse(xhr.responseText);  
var table = document.getElementById(“tableData”);

// Iterar sobre los resultados y agregarlos a la tabla HTML  
data.results.forEach(function(row) {  
var newRow = table.insertRow(-1);  
var idCell = newRow.insertCell(0);  
var nameCell = newRow.insertCell(1);  
var priceCell = newRow.insertCell(2);  
idCell.innerHTML = row.id;  
nameCell.innerHTML = row.name; // Acceder a la propiedad ‘NAME’  
priceCell.innerHTML = row.precio\_producto; // Acceder a la propiedad ‘PRECIO’  
});  
}  
};  
xhr.send();  
\</script\>

 ![](https://d2qpr2jzcazej7.cloudfront.net/original/3X/4/6/46abf5b991555b262fe4a5c79f54adad01ed78b9.png)

This is my database, and with the id values you can see that it connects with the database but only shows Ids, and Producto and Precio values are missing.

 ![MBravo0_1-1710609140864.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/8/2/8246dd23b2c8f15decc1ffaddbb5bb2c9ed2f34a.png)

 ![MBravo0_2-1710609369992.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/2/b/2b371bcca5b66f0624c7c1e9a598272119ceba1d.png)

 ![MBravo0_3-1710609419030.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/5/0/50803e61146db26df2618ab9f55d39726418353e.png)

Why aren´t the row values showing? Sorry about my english, its not my first language. Hope you can help me.

---

<div class="post-metadata">

**Author:** ![SteveHTM](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/stevehtm/32/22074_2.png) [@SteveHTM](https://community.hubspot.com/u/SteveHTM)\
**Post date:** [March 18, 2024, 2:00pm UTC](https://community.hubspot.com/t/hubdb-column-data-not-showing-using-api-call/102756/2 "2024-03-18T14:00:02Z")

</div>

@MBravo0 - I’ve undertaken a few projects using the public HubDB API like this, and all that you are doing looks consistent with my experience (esp. using the internal column name definitions). I would say that I have bumped up against limits on the size of database you can access this way. Dealing with those limits throws you into a world of async JavaScript calls which took me a while to figure out. But this is unlikely your porblem here 🙂

I have one question - forgive me for asking, but its tripped me up a number of times in development - have you “published” the version of the HubDB database that has the filled data fields you are trying to access?

Steve

---

<div class="post-metadata">

**Author:** ![MBravo0](https://avatars.discourse-cdn.com/v4/letter/m/8dc957/32.png) [@MBravo0](https://community.hubspot.com/u/MBravo0)\
**Post date:** [March 19, 2024, 2:25pm UTC](https://community.hubspot.com/t/hubdb-column-data-not-showing-using-api-call/102756/3 "2024-03-19T14:25:04Z")

</div>

Hi Steve, thanks for reply! Yes i already published the table. So, i don´t know what am i doing wrong.
