Is the loginEmail from PrivateMembersData the same as their account log-in from Wix (i.e the email they put in when they sign up for an account)? If so, you can get the email by doing the following:
import wixUsers from'wix-users';
import wixData from'wix-data';
wixUsers.currentUser.getEmail()
.then( (email) => {
let toSave = {
"email": email,
"image": $w('#yourImage').src
}
wixData.save("yourCollection", toSave)
})
If you need more information from the PrivateMembersData database you could do the following:
import wixUsers from'wix-users';
import wixData from'wix-data';
wixUsers.currentUser.getEmail()
.then( (email) => {
wixData.query("PrivateMembersData")
.eq("loginEmail", email)
.find()
.then( (results) => {
let item = results.items[0]
//here you can gather whatever information you need in the following way: Say you want to get their first name from a field with the field key firstName, you would do the following:
let firstName = item.firstName
//then, you will set up your save information
let toSave = {
"email": email,
"image": $w('#yourImage').src,
"firstName": firstName,
}
wixData.save("yourCollection", toSave)
})
})
Hope this helps ![]()