Link user profile information to user inputs

Hi Jack

There’s an easier approach… If you already have members’ info in a database, then I’d suggest adding a dataset to the page and changing the settings to show only the current logged in users’ info. Then, add a text element on the page, lets call it ‘textEmail’ and connect it to the email field in the members dataset.

Then, when submitting the form data, simply reference the emailText in your code like this:

import wixData from 'wix-data'; // ... 

export function submitButton_click(event, $w){
let toInsert = { 
"formField1": $w("#input1").value, 
"formField2": $w("#input2").value, 
"email": $w("#textEmail").value 
};  
wixData.insert("orderForm", toInsert)
}

Disconnect the UI submissions, this should work like a charm!

Tiaan