Database variable

Hello guys, all right?
So, I’m a beginner in Wix Code, and I am needing to do something really important to my website, but I don’t know if it’s possible, look:

I will have a database with three information.


And, in the dynamic page this layout


I would like that my client would have the option to select the information, like 3 hours, gasoline “or another thing wich I put there”, after clicking the calc and in the Website Title, be showed the information in the label “economia1”.

I don’t know if you have understood me, but is it possible do this?

Hi,

You can connect your dropdown element to a dataset list.
Each record will get its own line for the user to select.
Then if you want to change the value that is currently being displayed use this code skeleton in the onChange event for the dropdown element:

export function dropdown_change(event, $w) {
	//changes the current item index to the selected index
	$w("#dataset").setCurrentItemIndex(event.target.selectedIndex);
}

Hello, thank’s your return.

So, here it didn’t work, probably because I made something wrong.

But, what I would like to do, it’s something like this:

If dropdown1 it’s “3” and dropdown2 it’s “gasoline” the dropdown3 show “it”

In this case, I’ll have 5 different combinations to be showed.

For example, I connected the first two dropdwns with the database.


And, in the “título do site” I would like to show the variable information.

Hi,
I believe i know what you are trying to do, you need to connect each dropdown to the database under the category you want like this:


then you have two options:

  1. when the button is clicked, calculate the prize for the relevant data from the dropdown.
    Use https://www.wix.com/code/reference/$w.Dropdown.html#value, to get the dropdown’s value.
  2. when the button is clicked, use query to find the relevant data. Use “.eq” twice.
    check out query in the documentation here .

Good luck