Getting custom fields data

Thanks Bamuu for the reponse!

This is the code I am using current…

import wixUsers from 'wix-users';
import wixData from 'wix-data';

$w.onReady(function () {
let currentUser = wixUsers.currentUser;
currentUser.getEmail().then(email => {
wixData.query("member/PrivateMembersData")
.eq("email", email)
.find()
.then((results) => {
$w('#input8').value = results.items[0].preferred-location;
});
});

and this is the error I am getting which I can’t seem to figure out…



Error: e.text is not a function

And then the input8 value isnt updated with the details.

Any Ideas how I can get past this? Still very veryyyy new to javascript