Question:
Hi, I am using a code that retrieves data from member info specifically from a custom field
“wallet”
however it only recognize default fields like first name, last name etc… and when I replace my data - that is in the custom field - with last name it works (lastName)
import wixData from 'wix-data';
import wixUsers from 'wix-users';
$w.onReady(async function () {
const user = wixUsers.currentUser;
console.log("User logged in status:", user.loggedIn);
if (user.loggedIn) {
try {
const memberData = await wixData.get("Members/PrivateMembersData", user.id);
console.log("Full member data:", memberData);
console.log("Wallet:", memberData.contactDetails?.customFields?.wallet);
} catch (err) {
console.error("Error fetching member data:", err);
}
} else {
console.log("No user logged in");
}
});
I use this code to see this output
User logged in status: true
Full member data:
{...}
jsonTableCopy JSON
name:
"X X"
lastLogin:
"Wed Mar 12 2025 21:16:28 GMT+0300 (GMT+03:00)"
loginEmail:
"x@gmail.com"
_id:
"ID"
_createdDate:
"Thu Apr 04 2024 00:59:24 GMT+0300 (GMT+03:00)"
_updatedDate:
"Thu Apr 04 2024 00:59:24 GMT+0300 (GMT+03:00)"
slug:
"X"
phones:
[...]
lastName:
"X"
firstName:
"alper"
mainPhone:
"null"
language:
"en"
status:
"ACTIVE"
picture:
"https://l"
nickname:
"x x "
**Wallet: undefined**
as you see wallet field is undefined.
but if I use lastName as wallet its there and codes are working with that field.
Can you tell me how can I create a custom field that works like default fields?
Product:
Wix Studio
What are you trying to achieve:
What have you already tried:
Additional information: