# Help with Datatable search 

**URL:** <https://forum.wixstudio.com/t/help-with-datatable-search/8059>\
**Category:** Ask the community\
**Tags:** code, question\
**Created:** [July 17, 2018, 3:57pm UTC](https://forum.wixstudio.com/t/help-with-datatable-search/8059 "2018-07-17T15:57:49Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![coolatblue](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@coolatblue](https://forum.wixstudio.com/u/coolatblue)\
**Post date:** [July 17, 2018, 3:57pm UTC](https://forum.wixstudio.com/t/help-with-datatable-search/8059/1 "2018-07-17T15:57:49Z")

</div>

I have copied and pasted everything Yoav said about the matter and I still cannot seem to make a search for my database can anyone help?

---

<div class="post-metadata">

**Author:** ![doron-alkalay](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/doron-alkalay/32/2887_2.png) [@doron-alkalay](https://forum.wixstudio.com/u/doron-alkalay)\
**Post date:** [July 24, 2018, 9:24am UTC](https://forum.wixstudio.com/t/help-with-datatable-search/8059/2 "2018-07-24T09:24:42Z")

</div>

Hi Chaim!

Make sure that other than copy + paste you adjust the components reference names in the code to the ones you use in your site.

If you still encounter issues with this, feel free to share a link to your site so one of us, Wix Code Team, can inspect it and provide you with a solution.

Doron 🙂

---

<div class="post-metadata">

**Author:** ![coolatblue](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@coolatblue](https://forum.wixstudio.com/u/coolatblue)\
**Post date:** [July 25, 2018, 4:37am UTC](https://forum.wixstudio.com/t/help-with-datatable-search/8059/3 "2018-07-25T04:37:21Z")

</div>

// For full API documentation, including code examples, visit [Velo API Reference - Wix.com](http://wix.to/94BuAAs)  
**import** wixData **from** ‘wix-data’;

$w.onReady( **function** () {  
$w(“#table1”).columns = [{  
“id”: “col1”,  
“dataPath”: “services”,  
“label”: “avalible”,  
“width”: 100,  
“visible”: **true** ,  
“type”: “string”,  
}, {  
“id”: “col2”,  
“dataPath”: “imageURL”,  
“label”: “image”,  
“width”: 100,  
“visible”: **true** ,  
“type”: “string”,  
}, {  
“id”: “col3”,  
“dataPath”: “serviceName”,  
“label”: “Name”,  
“width”: 100,  
“visible”: **true** ,  
“type”: “string”,  
}];  
});//TODO: write your page related code here…

export function button1\_click(event, $w) {  
// Runs a query on the “Members” collection  
wixData.query(‘Bookings/Services’)  
// Query the collection for any items whose “Name” field contains  
// the value the user selected in the dropdown  
.contains(‘serviceName’, $w(‘#input1’).value)  
.find() // Run the query  
.then(res =\> {  
// Set the table data to be the results of the query  
$w(‘#table1’).rows = res.items;  
//$w(‘#table1’).show();  
});

}

This is the code I wrote, the results show but it does not filter properly

---

<div class="post-metadata">

**Author:** ![coolatblue](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@coolatblue](https://forum.wixstudio.com/u/coolatblue)\
**Post date:** [July 25, 2018, 4:37am UTC](https://forum.wixstudio.com/t/help-with-datatable-search/8059/4 "2018-07-25T04:37:50Z")

</div>

I would share my site but how can I do it privately?

---

<div class="post-metadata">

**Author:** ![doron-alkalay](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/doron-alkalay/32/2887_2.png) [@doron-alkalay](https://forum.wixstudio.com/u/doron-alkalay)\
**Post date:** [July 25, 2018, 9:08am UTC](https://forum.wixstudio.com/t/help-with-datatable-search/8059/5 "2018-07-25T09:08:37Z")

</div>

Hi Chaim!

Only authorized authorized personnel can inspect your site if you share a link to your editor.  
While we can see your editor, others will get a 404 error page.

Doron. 🙂

---

<div class="post-metadata">

**Author:** ![coolatblue](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@coolatblue](https://forum.wixstudio.com/u/coolatblue)\
**Post date:** [July 25, 2018, 3:40pm UTC](https://forum.wixstudio.com/t/help-with-datatable-search/8059/6 "2018-07-25T15:40:13Z")

</div>

[http://wix.to/5ECrAFg](http://wix.to/5ECrAFg)

---

<div class="post-metadata">

**Author:** ![coolatblue](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@coolatblue](https://forum.wixstudio.com/u/coolatblue)\
**Post date:** [July 25, 2018, 3:46pm UTC](https://forum.wixstudio.com/t/help-with-datatable-search/8059/7 "2018-07-25T15:46:01Z")

</div>

Am not sure why I am not able to add a table, I was working on a copy of this site  
I have added a user input and the code, if you can figure it out thanks!

---

<div class="post-metadata">

**Author:** ![doron-alkalay](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/doron-alkalay/32/2887_2.png) [@doron-alkalay](https://forum.wixstudio.com/u/doron-alkalay)\
**Post date:** [July 29, 2018, 10:48am UTC](https://forum.wixstudio.com/t/help-with-datatable-search/8059/8 "2018-07-29T10:48:02Z")

</div>

Hi!

I need a link to your site and not to a feedback page.  
Please share a link either to your published site or to your editor.

Doron.

---

<div class="post-metadata">

**Author:** ![coolatblue](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@coolatblue](https://forum.wixstudio.com/u/coolatblue)\
**Post date:** [July 29, 2018, 4:10pm UTC](https://forum.wixstudio.com/t/help-with-datatable-search/8059/9 "2018-07-29T16:10:19Z")

</div>

[Chrental.com](http://Chrental.com)  
Thanks

---

<div class="post-metadata">

**Author:** ![doron-alkalay](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/doron-alkalay/32/2887_2.png) [@doron-alkalay](https://forum.wixstudio.com/u/doron-alkalay)\
**Post date:** [August 1, 2018, 1:50pm UTC](https://forum.wixstudio.com/t/help-with-datatable-search/8059/10 "2018-08-01T13:50:08Z")

</div>

Hi Chaim!

After looking at your site and what I assume is the correct page that you’re referring to (‘real estate agents’) I can see that you use references to elements that doesn’t necessarily exists in your page.

Make sure that if you use in your code a reference to an element called ‘$w(“#table1”)’ you actually have it in your page and that all the elements Id’s are correctly called.

Please let us know if you still facing issues with it after making the needed adjustments.

Doron.

---

<div class="post-metadata">

**Author:** ![coolatblue](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@coolatblue](https://forum.wixstudio.com/u/coolatblue)\
**Post date:** [August 1, 2018, 4:13pm UTC](https://forum.wixstudio.com/t/help-with-datatable-search/8059/11 "2018-08-01T16:13:16Z")

</div>

Hi, As I mentioned in my comments that is not the issue (I was testing the code on a copy site with the table) I was not able to see the table in the userinput… I have added a table now, again the issue is it does not filter all it does it show all the items in the database Services.

What I would like to do is create search bar (sort of like the hotel search bar which would have categories and filters which a customer would be able to find each service and on each page have a filter for price…
