# help needed - Searching a dataset by name

**URL:** <https://forum.wixstudio.com/t/help-needed-searching-a-dataset-by-name/17116>\
**Category:** Ask the community\
**Tags:** code, question\
**Created:** [July 22, 2019, 4:04am UTC](https://forum.wixstudio.com/t/help-needed-searching-a-dataset-by-name/17116 "2019-07-22T04:04:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![steviecain](https://avatars.discourse-cdn.com/v4/letter/s/dec6dc/32.png) [@steviecain](https://forum.wixstudio.com/u/steviecain)\
**Post date:** [July 22, 2019, 4:04am UTC](https://forum.wixstudio.com/t/help-needed-searching-a-dataset-by-name/17116/1 "2019-07-22T04:04:38Z")

</div>

This is the first time i’ve ever used Corvid and am very much a beginner!  
I want users to be able to search their name in an input box (#input1) and a table (#table1) to display their number.

I’m having an issue and keep getting this error - “Parsing Error: unexpected token WixData”

If someone could check the code and advise if i’m making a simple mistake or advise if need to rename anything?

Code detailed below and also screenshots attached…

Thanks in advance!

```javascript
import wixData from "TablePlan"
export function input1_click
// Runs a query on the "TablePlan" collection
wixData.query("TablePlan") 
 // Query the collection for any items whose "Surname" field contains  
 // the value the user entered in the input element
  .contains("Surname", $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; 
   });

```

 ![](https://us1.discourse-cdn.com/wix/original/3X/8/c/8cfc277294bc9d5b916f65b83ab783a06b2c9199.png)

---

<div class="post-metadata">

**Author:** ![zzenithecho](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/zzenithecho/32/29894_2.png) [@zzenithecho](https://forum.wixstudio.com/u/zzenithecho)\
**Post date:** [August 29, 2021, 12:39am UTC](https://forum.wixstudio.com/t/help-needed-searching-a-dataset-by-name/17116/2 "2021-08-29T00:39:39Z")

</div>

I’m aware that this is two years late but since it’s still high in the search results, change your first line to be:

```javascript
import wixData from 'wix-data';

```
