# Data Collection and Table

**URL:** <https://forum.wixstudio.com/t/data-collection-and-table/28574>\
**Category:** Ask the community\
**Tags:** question, code\
**Created:** [September 29, 2017, 1:51pm UTC](https://forum.wixstudio.com/t/data-collection-and-table/28574 "2017-09-29T13:51:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tal-gal-cohen](https://avatars.discourse-cdn.com/v4/letter/t/34f0e0/32.png) [@tal-gal-cohen](https://forum.wixstudio.com/u/tal-gal-cohen)\
**Post date:** [September 29, 2017, 1:51pm UTC](https://forum.wixstudio.com/t/data-collection-and-table/28574/1 "2017-09-29T13:51:53Z")

</div>

I want to display the Data Collection as a table and interact with the table (change stuff on the page acording to the selected raw)

How can I do it?

---

<div class="post-metadata">

**Author:** ![ohad-laufer](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/ohad-laufer/32/669_2.png) [@ohad-laufer](https://forum.wixstudio.com/u/ohad-laufer)\
**Post date:** [October 1, 2017, 8:44am UTC](https://forum.wixstudio.com/t/data-collection-and-table/28574/2 "2017-10-01T08:44:28Z")

</div>

Hi,  
You should try using [onRowSelect()](https://www.wix.com/code/reference/$w.Table.html#onRowSelect) on your table. Using this event you can get the selected row data and add your logic to change things on the page accordingly.

```javascript
$w("#myTable").onRowSelect( (event) => { 
    let rowData = event.rowData; // {"fName": "John", "lName": "Doe"} 
    let rowIndex = event.rowIndex; // 2 
} );

```

---

<div class="post-metadata">

**Author:** ![tal-gal-cohen](https://avatars.discourse-cdn.com/v4/letter/t/34f0e0/32.png) [@tal-gal-cohen](https://forum.wixstudio.com/u/tal-gal-cohen)\
**Post date:** [October 1, 2017, 5:24pm UTC](https://forum.wixstudio.com/t/data-collection-and-table/28574/3 "2017-10-01T17:24:06Z")

</div>

10x!
