So I’m trying to avoid a using a dataset to display info from the PrivateMembersData database as this causes the input field to be greyed out and less easy to read.
Instead I’ve been trying to use a query to pull the information and then display it in a read only input field.
Here’s the code I’m working with:
$w.onReady( function () {
var user = wixUsers.currentUser;
var userId = user.id;
var isLoggedIn = user.loggedIn;
user.getEmail()
.then( (email) => {
let userEmail = email;
wixData.query(“PrivateMembersData”)
.eq(“loginEmail”, userEmail)
.find()
.then((results) => {
console.log(results)
let items = results.items;
let fN = items[0].firstName;
let lN = items[0].lastName;
$w(‘#input5’).value = fN;
$w(‘#input6’).value = lN;
$w(‘#input8’).value = userEmail
})
. catch ((err) => {
let errorMsg = err;
console.log(errorMsg);
});
})
I’m not even getting the console.log(results) to run so it leaves me thinking that there may be an issue with permissions to the database which you can’t change.
Any insight as to how I go about fixing this?