Email adress selected from dataset

Hi,
I got a Dropdown menu and a repeater that displays the selected data from the dropdown menu.

I use this code for that:

import wixData from 'wix-data' ;
let selectedBezirk = "";

export function dropdown1_change(event, $w) {
	wixData.query("Bezirke")
	.eq("title", $w("#dropdown1").value)
	.find()
	.then( (results) => {
		let firstItem = results.items[0];
		selectedBezirk = firstItem._id;
		
		wixData.query("repeaterdata")
		.eq("referenz" ,selectedBezirk)
		.find()
		.then ( (results) => {
			$w("#repeater1").data = results.items;
			 } )
			.catch( (err) => {
				let errorMsg = err;
				});
			});	

Now I want to get the email from the selected Item above to be in an input field


The code above shows the whole Item(row), now I need another code to only show the mail (column)

Is that somehow possible?

Thanks for your help!

Hey there Chris!

Please share a link to your site so one of us (Wix workers) can inspect it and provide you with an answer.

Doron. :slight_smile:

Thanks Doron.
Made a copy for you
https://ulrichchristian.wixsite.com/website-62

The Email adress should display in the #emailfirma input in the Email Form
The Site to inspect is “Badezimmer”

Hi Chris!

About returning the Mail thats not a problem, I’d suggest you to look into this thread.
It has what you need (of course that you’ll need to change the fields names and such).

You can also read about reference fields in this article.

Hope it helps!
Best of luck!

Doron. :slight_smile:

1 Like

Thanks for the Answer Doron.

The Email adress returned should be diffrent each time due to the selected option in the dropdown menu.