# Display search database results into a repeater

**URL:** <https://forum.wixstudio.com/t/display-search-database-results-into-a-repeater/20941>\
**Category:** Ask the community\
**Tags:** question, code\
**Created:** [May 26, 2020, 11:19pm UTC](https://forum.wixstudio.com/t/display-search-database-results-into-a-repeater/20941 "2020-05-26T23:19:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tiganom](https://avatars.discourse-cdn.com/v4/letter/t/a5b964/32.png) [@tiganom](https://forum.wixstudio.com/u/tiganom)\
**Post date:** [May 26, 2020, 11:19pm UTC](https://forum.wixstudio.com/t/display-search-database-results-into-a-repeater/20941/1 "2020-05-26T23:19:16Z")

</div>

Dear All, hope everybody is safe.

Please not that I am not a coder, but an avid learner. I am adding some search functionalities to my website. I used the CORVID tutorial to add the search function connected to a database with user input and displaying the results in a table. That worked great, amazing tutorial.

Now I want to step it up and instead of having a table I would like to have a repeater that display the results with all the additional info gathered from the database. I tried by myself adapting some code of other posts but the search doesn’t happen. Any help or redirection to pertinent posts would be amazing!!

Database: Reviews  
Repeater: repeater1  
Input box: input1  
search button: button1  
field key for search: title1

The first option that I used was:

* * *

import wixData from “wix-data”;

let repeater\_results = ‘’;

export function button1\_click(event) {  
//Add your code for this event here:  
wixData.query(“Reviews”)  
// Query the collection for any items whose “Name” field contains  
// the value the user entered in the input element  
.contains(“title1”, $w(“#input1”).value)  
.find() // Run the query  
.then(results =\> {  
let firstItem = results.items[0]  
repeater\_results = firstItem.\_id;

```
			wixData.query('Reviews') 
				.contains("title1", $w("#input1").value) 
				.find() 
				.then(results => {$w("#repeater1").data = results.items } 

```

* * *

The second option that I used was:

* * *

import wixData **from** “wix-data” ;

export function button1\_click(event) {  
//Add your code for this event here:  
wixData.query( “Reviews” )  
.contains( “title1” , $w( “#input1” ).value)  
.find() // Run the query  
.then(res =\> {  
// Set the table data to be the results of the query  
$w( “#repeater1” ).data = res.items;  
$w( “#repeater1” ).expand();  
})

* * *

Thank you so much for your help!  
Marco

---

<div class="post-metadata">

**Author:** ![anastasiias](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/anastasiias/32/15771_2.png) [@anastasiias](https://forum.wixstudio.com/u/anastasiias)\
**Post date:** [May 27, 2020, 7:28am UTC](https://forum.wixstudio.com/t/display-search-database-results-into-a-repeater/20941/2 "2020-05-27T07:28:37Z")

</div>

Hello,

Take a look at the examples below:

[Example: Search a Database](https://www.wix.com/corvid/forum/tips-tutorials-examples/example-search-a-database)  
[Example: Mega Search](https://www.wix.com/corvid/example/mega-search)  
[Example: Checkbox Dropdown filter](https://www.wix.com/corvid/example/checkbox-dropdown)

APIs you can refer to:

[https://www.wix.com/corvid/reference/wix-dataset.html](https://www.wix.com/corvid/reference/wix-dataset.html#setFilter)  
[https://www.wix.com/corvid/reference/wix-data.html](https://www.wix.com/corvid/reference/wix-data.html)  
[https://www.wix.com/corvid/reference/$w.Repeater.html](https://www.wix.com/corvid/reference/$w.Repeater.html)

Some related forum posts:

[https://www.wix.com/corvid/forum/community-discussion/search-function-for-a-repeater](https://www.wix.com/corvid/forum/community-discussion/search-function-for-a-repeater)  
[https://www.wix.com/corvid/forum/community-discussion/equal-to-or-more-than](https://www.wix.com/corvid/forum/community-discussion/equal-to-or-more-than)
