Saving current user email with befortInsert hook

I have a form to collect data but I need the user’s email without adding an email field to the form so I’m using the beforInsert hook but it’s not working. What is the best way to automatically add the user email on submit.

The code I tried and didn’t work

wixData.query("Members/PrivateMembersData")
.eq("_id", item._owner)
.find()
.then((results) => {
if (results.items) {
item.email = results.items[0].loginEmail;
} 
return item;
})

and

let user = wixUsers.currentUser,
userEmail;
user.getEmail()
.then((email) => {
userEmail = email;
});
item.email = userEmail;
return item;

If you know that the user who fills out the form is going to be a logged in site member, then you can simply set up a read only user input field that is connected to the Wix Members app Members/PrivateMembersData collection already.

As the site member is already logged in, the email shown here will be the site member’s own email specific for that site member from the Wix Members collection.

You can have this email hidden or shown on the page and as it is a user input, it will be included in the submit button for your form.

If you want to get it through code then you can by simply using Wix Users API and the getEmail function.
https://www.wix.com/corvid/reference/wix-users.User.html#getEmail

Thank you for the answer, but how could you connect one input element to 2 datasets, I need to connect it to the members dataset to get the value and to my dataset to save it with the form.