(Help) Dropdown menu that connents to DynamicPages

Looking to just get a code figured out. Any assistance would be greatly appreciated and I would be incredibly thankful.

I’m trying to connect my Dropdown menu’s item to their Database’s “Dynamic page”.
But having some difficulties and I’m not entirely understanding what I’m messing up with the coding.

The code giving me the trouble/error.

The error is mentioning “it must be a type string.”
What would be the correct way to write the code so it connects to the “A-Type-Type (type)” field?


But the code works perfectly fine when I use the manually entered “URL” field.

I would like the dropdown menu to connect to the Database’s auto-generated URL so that when I add a new type item to that database I won’t need to manually update the database URL each time a new “type” or multiple “types” are added to the Database.

Sorry! the screenshot is incredibly small for the error. (not entirely sure if it’s needed, but what I try and what I get when trying to change item)

Still looking for help with this.

Any help would be greatly appreciated…

You need to do toString.
https://www.w3schools.com/jsref/jsref_tostring_number.asp
https://www.w3schools.com/jsref/jsref_tolocalestring_number.asp

See here for using the Wix Location to function.
https://www.wix.com/corvid/reference/wix-location.html#to

Also, Nayeli (Code Queen) has a tutorial that might be suitable for your needs too.
Use dropdowns to navigate to another page on Wix - 8 lines of Code - Youtube tutorial
https://www.totallycodable.com/example-dropdown-navigation - Website tutorial

For the linking of two dynamic pages, here is another example page that might help you out.
https://www.vorbly.com/Vorbly-Code/WIX-CODE-LINK-TWO-DYNAMIC-PAGES

@givemeawhisky Thank you for pointing me in the right direction! Got the drop menu to work using the method described in the Youtube Tutorial.