# Multiple export functions - for dropdown

**URL:** <https://forum.wixstudio.com/t/multiple-export-functions-for-dropdown/13952>\
**Category:** Ask the community\
**Tags:** question, code\
**Created:** [November 19, 2018, 10:14pm UTC](https://forum.wixstudio.com/t/multiple-export-functions-for-dropdown/13952 "2018-11-19T22:14:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeffhanner10](https://avatars.discourse-cdn.com/v4/letter/j/45deac/32.png) [@jeffhanner10](https://forum.wixstudio.com/u/jeffhanner10)\
**Post date:** [November 19, 2018, 10:14pm UTC](https://forum.wixstudio.com/t/multiple-export-functions-for-dropdown/13952/1 "2018-11-19T22:14:30Z")

</div>

I am new to the HTML/CSS/JAVASCRIPT world. I understand the logic involved in programming and have used some of the examples from the tutorials to create a database collection and search fields. I have successfully designed a website with three User Input fields, all of which operate independently. And, I have successfully designed another website with one User Input and One Drop Down. However, I cannot add a second drop down without getting a “Parsing Error, export functions must be at the top level”. Here is my code so far. I would appreciate any help that is available.

Thank you.

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

**let** debounceTimer;

//search by title  
export function iTitle\_keyPress(event, $w) {

**if** (debounceTimer) {  
clearTimeout(debounceTimer);  
debounceTimer = undefined;  
}  
debounceTimer = setTimeout(() =\> {  
filter($w(‘#iTitle’).value,);  
}, 200);  
}  
**let** lastFilterTitle;

**function** filter(videoTitle) {  
**if** (lastFilterTitle !== videoTitle) {  
**let** newFilter = wixData.filter();  
$w(‘#dataset1’).setFilter(wixData.filter().contains(‘videoTitle’,videoTitle));  
lastFilterTitle = videoTitle;  
}  
}  
//search by category

export function dropdown1\_change(event,$w) {

// Runs a query on the “LHAUGVideo31” collection  
(wixData.query(“LHAUGVideo31”))  
// Query the collection for any items whose “Name” field contains  
// the value the user selected in the dropdown  
.contains(“category”, $w(“#dropdown1”).value)  
.find() // Run the query  
.then(res =\> {  
// Set the table data to be the results of the query  
$w(“#table1”).rows = res.items;

});

//search by instructors

export function dropdown2\_change(event,$w) {

// Runs a query on the “LHAUGVideo31” collection  
(wixData.query(“LHAUGVideo31”))  
// Query the collection for any items whose “Name” field contains  
// the value the user selected in the dropdown  
.contains(“instructors”, $w(“#dropdown2”).value)  
.find() // Run the query  
.then(res =\> {  
// Set the table data to be the results of the query  
$w(“#table1”).rows = res.items;

});

$w.onReady( **function** () {  
$w(“#table1”).columns = [  
//COLUMN 1 DATE  
{ “id”: “col1”,  
“dataPath”: “date”,  
“width” :100,  
“label”: “Date”,  
“visible”: **true** ,  
“type”: “date”,  
“linkPath”: “link-field-or-property”},

//COLUMN 2 TITLE  
{  
“id”: “col2”, // ID of the column for code purposes  
// The field key in the collection whose data this column displays  
“dataPath”: “videoTitle”,  
“label”: “Video Title”, // The column header  
“width”: 150, // Column width  
“type”: “string”, // Data type for the column  
// Path for the column if it contains a link  
“linkPath”: “link-field-or-property”  
},  
//COLUMN 3 DESCRIPTION

```
   { "id": "col3", // ID of the column for code purposes 

```

// The field key in the collection whose data this column displays  
“dataPath”: “videoDescription”,  
“label”: “Description”, // The column header  
“width”: 250, // Column width  
“type”: “string”, // Data type for the column  
// Path for the column if it contains a link  
“linkPath”: “link-field-or-property”},

//COLUMN 4 CATEGORY

```
  { "id": "col4", 

```

“dataPath”: “category”,  
“label”: “Category”,  
“width” :90,  
“visible”: **true** ,  
“type”: “string”,  
“linkPath”: “link-field-or-property”},

//COLUMN 5 PRESENTERS  
{ “id”: “col5”,  
“dataPath”: “instructors”,  
“label”: “Presenters”,  
“width” :100,  
“visible”: **true** ,  
“type”: “string”,  
“linkPath”: “link-field-or-property”},

//COLUMN 6 URL  
{ “id”: “col6”,  
“dataPath”: “videoLink”,  
“label”: “Category”,  
“width” :150,  
“visible”: **true** ,  
“type”: “URL”,  
“linkPath”: “link-field-or-property”},

// more column objects here if necessary  
// …  
// …

];  
});

---

<div class="post-metadata">

**Author:** ![\_or](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/_or/32/1004_2.png) [@\_or](https://forum.wixstudio.com/u/_or)\
**Post date:** [December 2, 2018, 10:30am UTC](https://forum.wixstudio.com/t/multiple-export-functions-for-dropdown/13952/2 "2018-12-02T10:30:24Z")

</div>

Hi,  
Please share your editor’s URL so we can inspect.

---

<div class="post-metadata">

**Author:** ![yisrael-wix](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/yisrael-wix/32/1107_2.png) [@yisrael-wix](https://forum.wixstudio.com/u/yisrael-wix)\
**Post date:** [December 2, 2018, 10:39am UTC](https://forum.wixstudio.com/t/multiple-export-functions-for-dropdown/13952/3 "2018-12-02T10:39:36Z")

</div>

The **dropdown2\_change()** function is nested inside of the **dropdown1\_change()** function. This is what’s causing your problem.

---

<div class="post-metadata">

**Author:** ![jeffhanner10](https://avatars.discourse-cdn.com/v4/letter/j/45deac/32.png) [@jeffhanner10](https://forum.wixstudio.com/u/jeffhanner10)\
**Post date:** [December 2, 2018, 1:37pm UTC](https://forum.wixstudio.com/t/multiple-export-functions-for-dropdown/13952/4 "2018-12-02T13:37:34Z")

</div>

Thanks for the help, but I’ve decided to combine the title field with the instructor field and drop the categories. It’s a much simpler code and it works fine for our purposes. If I get back to trying this again, I will re-post the issue.  
Thanks again.
