# Table not show data after assigning an array to Rows.

**URL:** <https://forum.wixstudio.com/t/table-not-show-data-after-assigning-an-array-to-rows/41346>\
**Category:** Ask the community\
**Tags:** code, question\
**Created:** [October 15, 2019, 9:02pm UTC](https://forum.wixstudio.com/t/table-not-show-data-after-assigning-an-array-to-rows/41346 "2019-10-15T21:02:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![diavolical](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/diavolical/32/15184_2.png) [@diavolical](https://forum.wixstudio.com/u/diavolical)\
**Post date:** [October 15, 2019, 9:02pm UTC](https://forum.wixstudio.com/t/table-not-show-data-after-assigning-an-array-to-rows/41346/1 "2019-10-15T21:02:55Z")

</div>

What the title says. This is my code. The rows properties returns the right data, after, but not actually showing in the table itself

// For full API documentation, including code examples, visit [Velo API Reference - Wix.com](https://wix.to/94BuAAs)  
import wixLocation from “wix-location”  
import wixData from “wix-data”  
import {session,local} from “wix-storage”  
$w.onReady( function () {  
//TODO: write your page related code here…  
if ( session.getItem(“logueado”) !== “si”)  
wixLocation.to(“/login”)  
console.log(local.getItem(“fullname”))  
PopulateTable()  
.then( (items) =\> {  
$w(“#table1”).rows = items;  
console.log($w(‘#table1’).rows)  
} );

//$w(“#text1”).text = local.getItem(“fullname”)  
});

export function PopulateTable(){  
**return** wixData.query(“pacientes”)  
.find()  
.then( (results) =\> {  
if (results.items.length \> 0) {  
let TableData = ;  
let TableRowData = {}  
let item;  
console.log("items " + results.items)  
//return results.items

// Add one row at a time to the TableData array by looping through the query results.  
**for** ( var i = 0; i \< results.items.length; i++) {  
item = results.items[i];

```
      TableRowData = {"Paciente": item.nombrecompleto,"telefono": item.telefono,"email": item.email}; 
      TableData.push(TableRowData); 

```

[//console.log](https://console.log)(TableData)  
//$w(‘#table1’).rows = TableData;  
}  
**return** TableData  
[//console.log](https://console.log)($w(‘#table1’).rows)  
//$w(‘#table1’).refresh() \*/  
} **else** {  
// no data found  
}  
} )  
. catch ( (err) =\> {  
let errorMsg = err;  
} );  
}  
I want to show only a few fields from the collection, that’s why I need to do it manually.

Cheers, Diego

---

<div class="post-metadata">

**Author:** ![diavolical](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/diavolical/32/15184_2.png) [@diavolical](https://forum.wixstudio.com/u/diavolical)\
**Post date:** [October 16, 2019, 6:36pm UTC](https://forum.wixstudio.com/t/table-not-show-data-after-assigning-an-array-to-rows/41346/2 "2019-10-16T18:36:48Z")

</div>

Any tips, or help???
