Database Dropdown List with button

I need help setting up a dropdown and a button, the first time I tried it worked, I followed the steps from this post -
Everytime I click my button. It takes me to the first URL on my database, not the corresponding URL on the database
This is my code -
import wixData from ‘wix-data’ ;
import wixLocation from ‘wix-location’ ;

export function dropdown1_change(event, $w) {
$w( “#dataset1” ).setCurrentItemIndex(

export function button1_click(event, $w) {$w( “#dataset1” ).getCurrentItem().url);


How do I change it so it links to the correct one?

This is how my dropdown, button and dataset are set up

Already tried to disconnect your button from DATASET?

I tried now but it doesn’t work

Try this one and take also a look into the CONSOLE!
Which resulst and messages do you get there?

import wixData from'wix-data'; 
import wixLocation from'wix-location';


Do your button-actions work ?

1 Like

@russian-dima Thank you! I managed to make it work

Do not forget to like it, if you really liked it :wink:

Good luck and happy coding.