The member profile information is saved in a different collection from the PrivateMembersData . To have acces to it, you should use WIX CRM Backend API .
So, you need to create a backend file (you can call it anything you want, for ex: members.jsw ), and in there you are going to create a simple function to be exported to your frontend code, like this:
//This imports the contacts object from the API
import { contacts } from 'wix-crm-backend'
//This options allows you to access the data
let options = {
"suppressAuth": true,
"suppressHooks": true
}
//This is the function you need to get all contacts
export async function queryAllContacts() {
const query = await contacts.queryContacts().find(options)
return query.items
}
After that, you create a code in your frontend (the page you are trying to access the data) that imports this functions and calls it. Like this:
//Importing the function you create in the backend
import { queryAllContacts } from 'backend/member'
//This functions runs after page is loaded
$w.onReady(async () => {
//You create a variable to store the retrieved data
const allMembers = await queryAllContacts()
//Just console.log it.
console.log(allMembers)
})
And the result is going to be an array with all the members in the site, as objects, and you can access the properties you want, even the extended fields that you created, like this Test custom field that I created:
"extendedFields": {
"contacts.displayByLastName": "Prado Bruno",
"emailSubscriptions.deliverabilityStatus": "NOT_SET",
"members.membershipStatus": "APPROVED",
"emailSubscriptions.subscriptionStatus": "NOT_SET",
"custom.test": "Amazing",
"members.mobile": false,
"emailSubscriptions.effectiveEmail": "bwprado@gmail.com",
"contacts.displayByFirstName": "Bruno Prado"
},
Best regards, and let me know how it went.