[RESOLVED] Is it possible to query PrivateMembersData

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?

1 Like

So after a few hours of searching I found that changing how i refer to the members database allows me to get the results I was looking for. In the code I pasted above, I simply needed to change:
wixData.query(“PrivateMembersData”)
to
wixData.query(“Members/PrivateMembersData”)
Not sure if it’s a good fix, but it worked for my purposes and hopefully can help others.