# Linking a Drop down box with a table

**URL:** <https://forum.wixstudio.com/t/linking-a-drop-down-box-with-a-table/26894>\
**Category:** Ask the community\
**Tags:** question, code\
**Created:** [January 13, 2018, 7:46pm UTC](https://forum.wixstudio.com/t/linking-a-drop-down-box-with-a-table/26894 "2018-01-13T19:46:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sunil-padmanabhan](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/sunil-padmanabhan/32/1528_2.png) [@sunil-padmanabhan](https://forum.wixstudio.com/u/sunil-padmanabhan)\
**Post date:** [January 13, 2018, 7:46pm UTC](https://forum.wixstudio.com/t/linking-a-drop-down-box-with-a-table/26894/1 "2018-01-13T19:46:03Z")

</div>

I have a drop down box with a list of values. Based on the dropdown box selection, I would want to filter the contents of my table. The Values in the dropdown matches a list of values in a particular column of the table. The table is connected to a dataset.  
I have written the below code, but it does not alter the contents of the table based on dropdown value selection

import wixData from ‘wix-data’;  
$w.onReady(function () {  
$w(“#dynamicDataset”).onReady( () =\> {  
$w(“#dropdown1”).onChange( () =\>  
{  
wixData.query(‘Rfclients’)  
.contains(‘Category’, $w(“#dropdown1”).value)  
.find()  
.then(res =\> {  
$w(‘#table1’).rows = res.items;  
});  
});  
});

Instead I tried the below code, the table gets refreshed but returns with empty records

import wixData from ‘wix-data’;

export function dropdown1\_change(event, $w) {  
$w(‘#text40’).text=$w(‘#dropdown1’).value;  
$w(“#dynamicDataset”).setFilter(wixData.filter()  
.contains(“Category”, $w(“#dropdown1”).value));  
}

---

<div class="post-metadata">

**Author:** ![system](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/system/32/86885_2.png) [@system](https://forum.wixstudio.com/u/system)\
**Post date:** [January 14, 2018, 3:01pm UTC](https://forum.wixstudio.com/t/linking-a-drop-down-box-with-a-table/26894/2 "2018-01-14T15:01:13Z")

</div>

Hi,

Try your first code, and add a [refresh()](https://www.wix.com/code/reference/wix-dataset.html#refresh) call for it.

Liran.
