# Urgent help !Connecting Data set to a table and drop menu as as filter.



**URL:** <https://forum.wixstudio.com/t/urgent-help-connecting-data-set-to-a-table-and-drop-menu-as-as-filter/23044>\
**Category:** Ask the community\
**Tags:** code, question\
**Created:** [May 6, 2020, 6:59am UTC](https://forum.wixstudio.com/t/urgent-help-connecting-data-set-to-a-table-and-drop-menu-as-as-filter/23044 "2020-05-06T06:59:56Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![isaacgannon23](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/isaacgannon23/32/18584_2.png) [@isaacgannon23](https://forum.wixstudio.com/u/isaacgannon23)\
**Post date:** [May 6, 2020, 6:59am UTC](https://forum.wixstudio.com/t/urgent-help-connecting-data-set-to-a-table-and-drop-menu-as-as-filter/23044/1 "2020-05-06T06:59:56Z")

</div>

Hello, I need help connecting a table and dropdown menu to a dataset.

I have been following some posts on this forum and youtube troubleshooting but I am not understanding why It is not working.  
This is my code

// For full API documentation, including code examples, visit [Velo API Reference - Wix.com](https://wix.to/94BuAAs)  
import wixData from ‘wix-data’ ;  
//This function replace the for loop:  
$w.onReady(() =\> {  
wixData.query( ‘carmakes’ )  
.find()  
.then(res =\> {  
let options = [{ “carMake” : ‘’ , ‘same’ : ‘All carmakes’ }];  
})  
});  
export function dropdown1\_click(event) {  
console.log($w( ‘#dataset1’ ));  
filter($w( ‘#dropdown1’ ).value);  
}

function filter (title) {  
$w( ‘#dataset1’ ).setFilter(wixData.filter().contains( ‘carBrand’ , title));  
}

If you need me to link to the website or any information about asset names etc let me know.

Any help would be greatly appreciated.

Kind regards

---

<div class="post-metadata">

**Author:** ![volkaertskristof](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/volkaertskristof/32/18158_2.png) [@volkaertskristof](https://forum.wixstudio.com/u/volkaertskristof)\
**Post date:** [May 6, 2020, 7:22am UTC](https://forum.wixstudio.com/t/urgent-help-connecting-data-set-to-a-table-and-drop-menu-as-as-filter/23044/2 "2020-05-06T07:22:38Z")

</div>

Hi isaac,  
are your names from title the same as the dropdown value?  
the dropdown has 2 fields Label and Value.  
dropdown.value takes the value part (starting with lowercase)  
if your title in your dataset starts with a capital letter it won’t work.

kristof.

---

<div class="post-metadata">

**Author:** ![isaacgannon23](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/isaacgannon23/32/18584_2.png) [@isaacgannon23](https://forum.wixstudio.com/u/isaacgannon23)\
**Post date:** [May 6, 2020, 11:15pm UTC](https://forum.wixstudio.com/t/urgent-help-connecting-data-set-to-a-table-and-drop-menu-as-as-filter/23044/3 "2020-05-06T23:15:34Z")

</div>

![](https://us1.discourse-cdn.com/wix/original/3X/7/a/7ae53dca815f4c94e58c864fa1be75f0587f58ce.png)

 ![](https://us1.discourse-cdn.com/wix/original/3X/0/5/05045b9e7e1b8153c4b6cecd79a0c64fd01a4a94.png)

 ![](https://us1.discourse-cdn.com/wix/original/3X/0/7/073243799f5f12e6ac86c33abfa5587fd80c7c2d.png)

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

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

 ![](https://us1.discourse-cdn.com/wix/original/3X/1/b/1b0da5b05dd2df7f52e001e4f4dfcc6af69feb2c.png)

Hey Kristof Thanks for getting back to me,  
Ill attach a screenshot of the labels of everything now

---

<div class="post-metadata">

**Author:** ![isaacgannon23](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/isaacgannon23/32/18584_2.png) [@isaacgannon23](https://forum.wixstudio.com/u/isaacgannon23)\
**Post date:** [May 6, 2020, 11:16pm UTC](https://forum.wixstudio.com/t/urgent-help-connecting-data-set-to-a-table-and-drop-menu-as-as-filter/23044/4 "2020-05-06T23:16:12Z")

</div>

![](https://us1.discourse-cdn.com/wix/original/3X/2/3/23a0eab2fce75a220f6913c1a3047d13fb03d259.png)

---

<div class="post-metadata">

**Author:** ![volkaertskristof](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/volkaertskristof/32/18158_2.png) [@volkaertskristof](https://forum.wixstudio.com/u/volkaertskristof)\
**Post date:** [May 7, 2020, 6:29am UTC](https://forum.wixstudio.com/t/urgent-help-connecting-data-set-to-a-table-and-drop-menu-as-as-filter/23044/5 "2020-05-07T06:29:23Z")

</div>

Hi @isaacgannon23 ,  
i didn’t see the problem first but its clear now.

in your on ready code you go check for evrything in the database “carmakes”  
but you don’t do anything with the value.  
also the pictures with “Field name”, “Field key”," Field type" are these from the database?  
ifso your “FieldName = Size” has a “Field Key = same” ?  
anyway the next code should work without needing a dataset since it goes straight to your database (wixData.query)

This code will show a full list of evry brand and the size of it:

```javascript
   wixData.query('carmakes')    
   .find()    
   .then(res => { // res are all your items from the database
 let options = [{"carMake": '', 'same': 'All carmakes'}];
 for (var i = 0; i < res.length; i++) { 
   options.push({"label": res[i].carBrand, "value": res[i].same});
    $w("#dropdown1").options = options; // 
                }})
       })

```

normaly you also can just connect your dataset to your dropdown without code.

i also just readed you needed to connect the dataset/database to a table.  
what exactly do you want to show in the table?

kristof.

---

<div class="post-metadata">

**Author:** ![isaacgannon23](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/isaacgannon23/32/18584_2.png) [@isaacgannon23](https://forum.wixstudio.com/u/isaacgannon23)\
**Post date:** [May 7, 2020, 6:50am UTC](https://forum.wixstudio.com/t/urgent-help-connecting-data-set-to-a-table-and-drop-menu-as-as-filter/23044/6 "2020-05-07T06:50:20Z")

</div>

@volkaertskristof Hey Kristof,  
Thanks for your help. This is my first Wix project so when I was assigning values I didn’t really understand the impact of them. What I want to show in the table are the car make(Prius) and the size (s/xs) and I want this to be selected by the drop-down filter by the car brands(Toyota). The images of “Field name”, “Field key”," Field type"  
Thanks a lot for your help.  
Isaac

---

<div class="post-metadata">

**Author:** ![volkaertskristof](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/volkaertskristof/32/18158_2.png) [@volkaertskristof](https://forum.wixstudio.com/u/volkaertskristof)\
**Post date:** [May 7, 2020, 6:58am UTC](https://forum.wixstudio.com/t/urgent-help-connecting-data-set-to-a-table-and-drop-menu-as-as-filter/23044/7 "2020-05-07T06:58:39Z")

</div>

@isaacgannon23  
oke so if you use my code you will get a huge list of items in your dropdown that aren’t needed there.  
what you will need to do is just manualy add label and value to your dropdown  
or make a seperate database with only carbrands and size. that you only have 1 of them.  
(now you will have a few times volvo a few time citroën etc…)

that done, connect your dataset1 to your table without code.  
you should be able to connect each field properly that way.

make sure the dataset is read only.

then your filter data should work aslong as the added values in the dropdown are the same as the values to compare in the dataset

kristof.

---

<div class="post-metadata">

**Author:** ![isaacgannon23](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/isaacgannon23/32/18584_2.png) [@isaacgannon23](https://forum.wixstudio.com/u/isaacgannon23)\
**Post date:** [May 7, 2020, 7:16am UTC](https://forum.wixstudio.com/t/urgent-help-connecting-data-set-to-a-table-and-drop-menu-as-as-filter/23044/8 "2020-05-07T07:16:09Z")

</div>

@volkaertskristof  
So I added the code to the web page and it comes up with this  
parsing web-module ‘public/pages/enufv.js’: Unexpected token (11:7) while parsing file: public/pages/enufv.js  
then when I remove the last “})” of your code the drop-down still doesn’t connect. Is there some setting I may have to apply to the dropdown menu?

Isaac

---

<div class="post-metadata">

**Author:** ![isaacgannon23](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/isaacgannon23/32/18584_2.png) [@isaacgannon23](https://forum.wixstudio.com/u/isaacgannon23)\
**Post date:** [May 7, 2020, 7:18am UTC](https://forum.wixstudio.com/t/urgent-help-connecting-data-set-to-a-table-and-drop-menu-as-as-filter/23044/9 "2020-05-07T07:18:31Z")

</div>

I will add the labels manually to the drop down list. I think I miss understood what you said. My apologies.

---

<div class="post-metadata">

**Author:** ![volkaertskristof](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/volkaertskristof/32/18158_2.png) [@volkaertskristof](https://forum.wixstudio.com/u/volkaertskristof)\
**Post date:** [May 7, 2020, 7:37am UTC](https://forum.wixstudio.com/t/urgent-help-connecting-data-set-to-a-table-and-drop-menu-as-as-filter/23044/10 "2020-05-07T07:37:44Z")

</div>

Let me know how it goes  
if it doesn’t work as needed i can always take some time to make a small image example.

kristof.

---

<div class="post-metadata">

**Author:** ![isaacgannon23](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/isaacgannon23/32/18584_2.png) [@isaacgannon23](https://forum.wixstudio.com/u/isaacgannon23)\
**Post date:** [May 7, 2020, 8:06am UTC](https://forum.wixstudio.com/t/urgent-help-connecting-data-set-to-a-table-and-drop-menu-as-as-filter/23044/11 "2020-05-07T08:06:57Z")

</div>

@volkaertskristof Hey  
I’m running into an issue now where all of the values show up in the preview then once I select a different drop-down item it doesn’t load any values. Any ideas on where I’m going wrong?

---

<div class="post-metadata">

**Author:** ![volkaertskristof](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/volkaertskristof/32/18158_2.png) [@volkaertskristof](https://forum.wixstudio.com/u/volkaertskristof)\
**Post date:** [May 7, 2020, 8:13am UTC](https://forum.wixstudio.com/t/urgent-help-connecting-data-set-to-a-table-and-drop-menu-as-as-filter/23044/12 "2020-05-07T08:13:58Z")

</div>

can you show me in an image what you exactly mean?

---

<div class="post-metadata">

**Author:** ![volkaertskristof](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/volkaertskristof/32/18158_2.png) [@volkaertskristof](https://forum.wixstudio.com/u/volkaertskristof)\
**Post date:** [May 7, 2020, 8:41am UTC](https://forum.wixstudio.com/t/urgent-help-connecting-data-set-to-a-table-and-drop-menu-as-as-filter/23044/13 "2020-05-07T08:41:35Z")

</div>

you can do it without a single line of code.  
Add a dataset , Dropdown, table :

 ![](https://us1.discourse-cdn.com/wix/original/3X/7/4/744f5e74c470504f5d719861c7bc3e2b03cffa86.png)

Add your choices to your dropdown :

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

 ![](https://us1.discourse-cdn.com/wix/original/3X/d/4/d43a73e2e1c9bc52e96f902ab432ad7182bb758d.png)

Connect your dataset with your table.  
the row Title will be added aswel but you can just go to table content and remove it from the list.

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

add filters to your dataset.  
where you select Field CarBrand(Tekst) you have to filter on the sort on brand dropdown.

 ![](https://us1.discourse-cdn.com/wix/original/3X/b/c/bc649a895270e35076826f5cb002afd662ecbebd.png)  
Where you select Field Size(tekst) you have to filter on the Sort on Size dropdown.

 ![](https://us1.discourse-cdn.com/wix/original/3X/9/9/9995a5ce9687c2c7ab82219791d6892d54b458dc.png)

This works for me:

 ![](https://us1.discourse-cdn.com/wix/original/3X/2/e/2e5a73388d89a80259ad58fcd74650eaf2c1753d.png)

 ![](https://us1.discourse-cdn.com/wix/original/3X/6/f/6f9d96bba7828f41aab927c406888293ba9fc777.png)

 ![](https://us1.discourse-cdn.com/wix/original/3X/d/5/d57e90eaf1153cedda669f0f6ce1330b464cc92b.png)

---

<div class="post-metadata">

**Author:** ![isaacgannon23](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/isaacgannon23/32/18584_2.png) [@isaacgannon23](https://forum.wixstudio.com/u/isaacgannon23)\
**Post date:** [May 7, 2020, 8:54am UTC](https://forum.wixstudio.com/t/urgent-help-connecting-data-set-to-a-table-and-drop-menu-as-as-filter/23044/14 "2020-05-07T08:54:01Z")

</div>

![](https://us1.discourse-cdn.com/wix/original/3X/6/4/64badbe899be4d5b6513dc45a08705674dd9cdc2.jpeg)

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

---

<div class="post-metadata">

**Author:** ![isaacgannon23](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/isaacgannon23/32/18584_2.png) [@isaacgannon23](https://forum.wixstudio.com/u/isaacgannon23)\
**Post date:** [May 7, 2020, 8:55am UTC](https://forum.wixstudio.com/t/urgent-help-connecting-data-set-to-a-table-and-drop-menu-as-as-filter/23044/15 "2020-05-07T08:55:59Z")

</div>

Hey again, I tried to follow those steps and i think i did the exact same but I still am having the same issue where it wont load. I will try it without the code and see if it works

---

<div class="post-metadata">

**Author:** ![isaacgannon23](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/isaacgannon23/32/18584_2.png) [@isaacgannon23](https://forum.wixstudio.com/u/isaacgannon23)\
**Post date:** [May 7, 2020, 8:59am UTC](https://forum.wixstudio.com/t/urgent-help-connecting-data-set-to-a-table-and-drop-menu-as-as-filter/23044/16 "2020-05-07T08:59:27Z")

</div>

![](https://us1.discourse-cdn.com/wix/original/3X/5/c/5c896cb2b5ceeb42ad583d381fd4a077d8ec5c08.png)  
This is what the table looks like when the page initially loads then it goes blank to the previous one above after I try to change the dropdown menu filter.

---

<div class="post-metadata">

**Author:** ![isaacgannon23](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/isaacgannon23/32/18584_2.png) [@isaacgannon23](https://forum.wixstudio.com/u/isaacgannon23)\
**Post date:** [May 7, 2020, 9:24am UTC](https://forum.wixstudio.com/t/urgent-help-connecting-data-set-to-a-table-and-drop-menu-as-as-filter/23044/17 "2020-05-07T09:24:17Z")

</div>

@volkaertskristof Hey thank you so much I just added you so you can remove your email Sorry I am busy for the next hour. I appreciate this alot thank you for taking your time to help !

---

<div class="post-metadata">

**Author:** ![volkaertskristof](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/volkaertskristof/32/18158_2.png) [@volkaertskristof](https://forum.wixstudio.com/u/volkaertskristof)\
**Post date:** [May 7, 2020, 9:52am UTC](https://forum.wixstudio.com/t/urgent-help-connecting-data-set-to-a-table-and-drop-menu-as-as-filter/23044/18 "2020-05-07T09:52:10Z")

</div>

@isaacgannon23  
no problem.  
i added it to your website.  
i sa you had a dynamic dataset.  
they don’t work the same as a normal dataset so i adjusted where needed.  
so i added a small amount of code to make it work.

If you have any further questions.  
let me know.

---

<div class="post-metadata">

**Author:** ![lucasai](https://avatars.discourse-cdn.com/v4/letter/l/3ec8ea/32.png) [@lucasai](https://forum.wixstudio.com/u/lucasai)\
**Post date:** [May 10, 2020, 8:34pm UTC](https://forum.wixstudio.com/t/urgent-help-connecting-data-set-to-a-table-and-drop-menu-as-as-filter/23044/19 "2020-05-10T20:34:27Z")

</div>

Hi, thanks for the guide! Can i use this filtering system for PRICE with a bar for user?  
es. —-|—  
\<10.000€

> 10.000€\<20.000€  
> 20.000€\<50.000€  
> thanks  
> luca

---

<div class="post-metadata">

**Author:** ![volkaertskristof](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/volkaertskristof/32/18158_2.png) [@volkaertskristof](https://forum.wixstudio.com/u/volkaertskristof)\
**Post date:** [May 11, 2020, 6:29am UTC](https://forum.wixstudio.com/t/urgent-help-connecting-data-set-to-a-table-and-drop-menu-as-as-filter/23044/20 "2020-05-11T06:29:44Z")

</div>

Hi lucasai  
i’m glad you liked the guide.  
can you make a new question post so we do not bump this question.  
i will take a look when i have the time.

kristof.
